Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using request.setAttribute in a JSP page

Tags:

People also ask

How can we use setAttribute request in JSP?

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.

What is request getParameter in JSP?

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().

Why do we use setAttribute in Java?

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?