getting the form name

How can I get the name of a form that posts to a JSP, or Servlet ?
Who is Participating?
pellepConnect With a Mentor Commented:
Short answer, you can't. The name of the form is not submitted in the HTTP protocol, regardless of wheather you do POST or GET. You'll have to add the name of the form as a hidden input field in the form.
simiAuthor Commented:
I thought of the solution with the hidden form.
However I was wondering if I am just creating a redundant variable.
Weird, why do they allow you to have a name attribute for the form, when you can't use it.
Well, the name is useful if you intend to use javascript for any dynamic feature on your page.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.