Getting value of submit button using jsp

Darling, I have a form with several submit buttons like this

<FORM NAME="form1" METHOD="POST" Action="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?

+5
source share
1 answer

It is simply by name available as a request parameter.

String submit = request.getParameter("submit");

See also:


However, JSP is the wrong place for the postprocess to submit the form. Use a Servlet .

+8
source

All Articles