Servlet DoPost
Dear Friends;
Suppose we produced an HTML page using the doGet method which contains five
different submit buttons and now we want to produce a servlet doPost method
in a way that by pressing every each one of these keys something we desire happens.
How shall I write my "if" statements in the doPost method?
regards
Ehsan Farzam
请先登录再写评论。
ehsan wrote:
IIRC, you can give the buttons different name attributes (e.g.
name="button1", ..., name="button5"). If you click on say
button3, the request will contain parameters named button3.x
and button3.y. This is how you can detect which button was
pressed.
Regards,
Jens