In JSP, session is an implicit object of type HttpSession.The Java developer can use this object to set,get or remove attribute or to get session information.
|
Example of session implicit object
index.html
welcome.jsp
second.jsp
Output
pageContext implicit object
In JSP, pageContext is an implicit object of type PageContext class.The pageContext object can be used to set,get or remove attribute from one of the following scopes:
|
In JSP, page scope is the default scope.
|
Example of pageContext implicit object
index.html
welcome.jsp
second.jsp
Output
page implicit object:
In JSP, page is an implicit object of type Object class.This object is assigned to the reference of auto generated servlet class. It is written as:
| |
Object page=this;
| |
For using this object it must be cast to Servlet type.For example:
| |
<% (HttpServlet)page.log("message"); %>
| |
Since, it is of type Object it is less used because you can use this object directly in jsp.For example:
| |
<% this.log("message"); %>
exception implicit object
Example of exception implicit object:error.jsp |
No comments:
Post a Comment