Difference between Request Parameters and Scoped variables in Servlet and JSP.
They can be sent to the server as QueryString parameters:
Code:
"http://myApp?first_name=Geetu"
or as Form Parameters:
Code:
form method="post" action="myApp"
input type="text" name="first_name" value="Geetu" /
input type="submit" value="Enter" /
/form
You would retrieve these in your servlet with: request.getParameter("first_name")
In a JSP, with EL you retrieve it with the param keyword:
${param.first_name}
They can not be objects because browsers can't send objects. They are always Strings or arrays of Strings.
Scoped variables, on the other hand are objects which are bound to page, request, session, or application scope. These variables can be accessed directly from EL
Objects are bound into the scopes using the setAttribute method in one of those scopes in Servlet, or using c:set