开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜