JSP Implicit Objects
JSP Implicit Objects
JSP provides standard or predefined implicit objects, which can use directly in JSP page using JSP Scriptlet. The implicit objects are Servlet API class type and created by JSP containers
There are 9 jsp implicit objects. These objects are created by the web container (JSP containers) that are available to all the jsp pages.
The available implicit objects are out, request, response, page, pageContext, exception, config, session and application.
List of all 9 implicit object are;
Class type | Object | |
---|---|---|
1 | HttpServletRequest | request |
2 | HttpServletResponse | response |
3 | ServletConfig | config |
4 | ServletContex | application |
5 | HttpSession | session |
6 | JspWriter/PrintWriter | out |
7 | Exception | exception |
8 | PageContext | pagecontext |
9 | Object | page |
All implicit objects of jsp are accessible with in the expression and scriptlet of the jsp, but not accessible in the declaration tags of the jsp.
In a jsp session and exception object are not available always. Because session object depends on session attribute of the page directive and exception depends on isErrorPage attribute of the page directive.
In a jsp, session object is available, if session equals to true in page directive.
In a jsp an exception object is available, if isErrorPage is equal to true in page directive.