These objects are defined as implicit because you do not have to explicitly declare them.
Because implicit objects are declared automatically we need only use the reference
variable associated with a given object to begin calling methods on it.
JSP container will create these objects automatically and
the container makes them available to the developers.
The implicit objects are parsed by the container and
inserted into the generated servlet code.
1.request
2.response
3.page
4.application
5.session
6.pagecontext
7.exception
8.out
9.config
Ex: request.getElementById("xyz");
here you are using 'request' object without instantiating it because this object
is readily available for you.
Example:
If i want to put my username in the session in JSP.
JSP Page:
<%
String name=request.getParameter("Username");
session.setAttribute("UserName",name);
%>
<%=request.getRequestURI()%>
Because implicit objects are declared automatically we need only use the reference
variable associated with a given object to begin calling methods on it.
JSP container will create these objects automatically and
the container makes them available to the developers.
The implicit objects are parsed by the container and
inserted into the generated servlet code.
1.request
2.response
3.page
4.application
5.session
6.pagecontext
7.exception
8.out
9.config
Ex: request.getElementById("xyz");
here you are using 'request' object without instantiating it because this object
is readily available for you.
Example:
If i want to put my username in the session in JSP.
JSP Page:
<%
String name=request.getParameter("Username");
session.setAttribute("UserName",name);
%>
<%=request.getRequestURI()%>
No comments:
Post a Comment