Dmitry
Dmitry

Reputation: 331

Get name of the form in servlet

<form name="GetAll"
      method="post"
      action="NewServlet">
            <input type="text" name="des">
            <input type="submit">
</form>

How I can get name of this form (GetAll) in my NewServlet servlet?

Upvotes: 0

Views: 779

Answers (1)

Jivanysh Sohoni
Jivanysh Sohoni

Reputation: 57

The name attribute of the form is not part of the HTTP request when it is submitted. You could add a hidden field instead to identify multiple forms off same page like

<input type="hidden" name="formName" value="formA">

keeping the name attribute of the hidden input same of course.

Upvotes: 2

Related Questions