1) First create data at the server side and pass it to a JSP. Here a list of student objects in a servlet will be created and pass it to a JSP using setAttribute(). 2) Next, the JSP will retrieve the sent data using getAttribute(). 3) Finally, the JSP will display the data retrieved, in a tabular form.
getParameter is a function name in JSP which is used to retrieve data from an HTML/JSP page and passed into the JSP page. The function is designated as getParameter() function. This is a client-side data retrieval process. The full function can be written as request. getParameter().
The setAttribute() method of a SimpleScriptContext class is used to set the value of an attribute in a given scope where the name of the attribute, the value of attribute and scope of the attribute is passed as parameters.
Is it possible to use request.setAttribute
on a JSP page and then on HTML Submit get the same request attribute in the Servlet
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With