JSP Implicit Objects
JSP Implicit Objects
implicit objects are created by the web container that are available to all the jsp pages.
There are in total 9 Implicit objects
Request: Its purpose is to get the data on a JSP page which has been entered
by user on the previous JSP page.
Response: Response object helps the user to give the response to the client after page load.
Example: response.sendRedirect("http://studyeasy.org");
Session: It is used for storing user’s data to make it available on other JSP pages till the user
session is active.
Example: session.getAttribute(“name”);
Application: it is used for getting application wide initialized parameter(s) and to maintain
useful data across whole JSP application.
Example: application.getAttribute(“BuiltVer”);
Exception: This object is used in exception handling for displaying the error messages. This
object is only available to the JSP pages, which has isErrorPage set to true.
Example:
Page: The page implicit object represents the JSP page itself. It is of type object. It is rarely used
in JSP pages.
pageContext: pageContext implicit object provides methods to access other implicit objects.
Specifically pageContext object has methods like getPage, getRequest, getResponse etc. It also
provides methods to set and get attributes. The scope of the pages attribute is the processing of
that page.
Config: This is a Servlet configuration object and mainly used for accessing getting
configuration information such as servlet context, servlet name, configuration parameters etc.
Example: String servletName=config.getServletName();