getting the submit button value using jsp
Dear All, I have a form with multi submit buttons like this
<FORM NAME="form1" METHOD="POST" Action开发者_如何学Go="SomePage.jsp">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 1">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 2">
<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Button 3">
</FORM>
How can i get the submit value using JSP ?
It's just by its name available as request parameter as well.
String submit = request.getParameter("submit");
See also:
- Hidden features of HTML
That said, a JSP is the wrong place to postprocess a form submit. Use a Servlet.
精彩评论