JSP Implicit Objects

tutorial and example
tutorial and example

In JSP, implicit objects are pre-defined objects, created by the web container. These objects are created during the translation phase from JSP to Servlet. JSP allows you to call these objects directly without initializing them.

Implicit objects are required to be declared in scriptlet tags only. Hence, in translation phase these objects are embedded within service() method of servlet.

Note: – Servlet provide these objects to enhance the ease of coding in JSP.

List of JSP implicit objects

JSP provides 9 implicit objects that can be used in JSP pages. Each object represents some unique identity. Here, is the list of all implicit objects with their classes.

        Object

                           Classes

out

javax.servlet.jsp.JspWriter

request

javax.servlet.http.HttpServletRequest

response

javax.servlet.http.HttpServletResponse

config

javax.servlet.ServletConfig

application

javax.servlet.ServletContext

session

javax.servlet.http.HttpSession

exception

javax.servlet.http.HttpException

Page

java.lang.object

PageContext

javax.servlet.jsp.PageContext

We will learn more about each object with simple examples.