Implicit Object in JSP

In JSP implicit objects simplifies the development of web application.
There are 9 JSP implicit objects available in JSP.


1. request
2. response
3. out
4. config
5. Application
6. session
7. page
8. PageContext
9. Exception

let’s take overview of it after that we will understand it with Example



request


This is the HttpServletRequest object associated with the request.

response


This is the HttpServletResponse object associated with the response to the client.

out


This is the PrintWriter object used to write any data to buffer.

session


This is the HttpSession object associated with the request.

application


This is the ServletContext object associated with application context.

config


This is the ServletConfig object associated with the page.

pageContext


This encapsulates use of server-specific features like higher performance JspWriters.

page


This is simply a synonym for this, and is used to call the methods defined by the translated servlet class.

Exception


The Exception object allows the exception data to be accessed by designated JSP.



In case of servlet we have to get this all object using some another object
but in case of JSP this all object are available for each and Every JSP page.

i.e

for Servlet

1
2
 PrintWriter out=resp.getWriter();
 out.println("Hi This is Bhavesh Lakhani");

for JSP

1
2
3
4
5
6
 
<% 
 
out.println("Hi This is Bhavesh Lakhani"); 
 
%>

Available JSP implicit objects and Its Type


implicit-object

Leave a Reply

Your email address will not be published. Required fields are marked *