devxlogo

Form Input and JSP

Form Input and JSP

Question:
I want to collect form data in a JSP page where the form issubmitted by one of many possible links (possibly passing values usingURL rewriting). In one case, I have one text input box, followed bytwo links. The text input box’s data ends up in the HttpServletRequestobject. How do I pass the URLs of the links to the JSP page?

Answer:
The normal way to pass extra data from an HTML form to a JSP pageis through hidden input tags. The values of the hidden input willbe included in the HttpServletRequest object as parameters,retrievable with either getParameter() or getParameterValues(). Anexample of using the HTML hidden tag is:

See also  How College Students Can Shape the Future of Tech Responsibility
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist