In this section we will read about the implicit objects in JSP.
This section will describe you the various implicit objects defined in JSP.
These implicit objects are defined in JSP for developing the fast web
application purpose. A Java developer can use these objects directly in their
code. Implicit objects are created by the web container, these objects are
called the Java objects that implements the Servlet and JSP API's interfaces. In
JSP nine (9) implicit objects are defined these are as follows :
request : An implicit object request, specifies the client
request. To access the HTTP request, class of this object implements the
HttpServletRequest interface however, javax.servlet.http.HttpServletRequest
extends the javax.servlet.ServletRequest interface. Using the request
implicit object you can get the request parameters, request attributes,
header information and many more related to HTTP request. Container passes
request object to the _jspService()method as a parameter. Scope this object
is specified for a request made by the client.
response : An implicit object response, specifies the response
to be given to the client. To provide the HTTP response, class of this
object implements the HttpServletResponse interface however,
javax.servlet.http.HttpServletResponse extends the
javax.servlet.ServletResponse interface. Using the response object you can
manipulate the response to be given to the client such as contentType of
response can be set, cookie can be added to response, the response can be
An implicit object out, specifies the output content of the respons. Using
this implicit object you can access the output stream of servlet. Scope of
this object is specified for a page. This object is an instance of
session : An implicit object session, specifies the client
specific conversation. Class of this object implements the
javax.servlet.http.HttpSession interface. Using this object you can
established a seesion, state for a single user and many more. This object
has the session scope.
application : An implicit object application, specifies the
information of web application in which it runs. Class of this object
implements the javax.servlet.ServletContext interface. Scope of this
implicit object is specified for the whole application.
exception : An implicit object exception, specifies the
occurred exception. In a JSP page when an exception is occurred control is
passed to the JSP error page. This object is an instance of
java.lang.Throwable class. Scope of this object is specified for a page.
config : An implicit object config, specifies the
configuration of JSP page's servlet. This object is used to get the
available initialization parameter. Class of this object implements the
javax.servlet.ServletConfig interface. Scope of this object is specified for
the JSP page.
page : An implicit object page, specifies the current
JSP page. This object is an instance of java.lang.Object class. page
implicit object consumes large memory.
pageContext : An implicit object pageContext, specifies the
context information. This implicit object is an instance of the
javax.servlet.jsp.PageContext abstract class. Using this method you can set
and get attributes in different scopes and can transfer request to other