Implicit Objects in JSP
JSP provide access to some implicit object which represent some commonly used objects for servlets that JSP page developers might need to use. For example you can retrieve HTML form parameter data by using request variable, which represent the HttpServletRequest object.
Following are the JSP implicit object
Implicit Object | Description |
---|---|
request | The HttpServletRequest object associated with the request. |
response | The HttpServletRequest object associated with the response that is sent back to the browser. |
out | The JspWriter object associated with the output stream of the response. |
session | The HttpSession object associated with the session for the given user of request. |
application | The ServletContext object for the web application. |
config | The ServletConfig object associated with the servlet for current JSP page. |
pageContext | The PageContext object that encapsulates the enviroment of a single request for this current JSP page |
page | The page variable is equivalent to this variable of Java programming language. |
exception | The exception object represents the Throwable object that was thrown by some other JSP page. |
All of them are very useful and you will slowly get to know all of them as you will move ahead into your career working on live projects. For example: When you will create an application where in User sessions have to be created
session
will come into picture, request
is used when you have form submissions in your application etc.
We will learn about these in details later on.