JSP Implicit Objects

JSP Implicit Objects

There are 9 jsp implicit objects are available to all jsp pages, which are created by the web container. JSP Implicit Objects are also called pre-defined variables.

 

  1. page: This is a synonym for this. This is used to call methods defined by the translated servlet class.
  2. out : This is the PrintWriter object which is used to print output.
  3. request: This is the HttpServletRequestobject which is associated with the request.
  4. response: This is the HttpServletResponseobject which is associated with the response.
  5. session: This is the HttpSession object which is associated with request.
  6. application: This is the ServletContext object which is associated with application context.
  7. config: This is the ServletConfig object associated with the page.
  8. pageContext: This is the object PageContext
  9. Exception: The Exception object allow the exception data to be accessed by designated JSP.

 

  1. page: This implicit object is assigned  a reference to the servlet. Page is a instace of JSP page’s servlet processing the current request.This is a synonym for this, it means we can simpy use this keyword in place of page implicit object. This used to call methods defined by the translated servlet class.

 

  1. out: This implicit object is used to writing data to the buffer. This is the object of PrintWriter, but we don’t to create its object in JSP like Servlet.

The Servlet Syntax is

Example:  In this example we are simply displaying our message.

Output:

1