Implicit Objects tutorial in JSP

Implicit objects

Implicit objects are Java objects in JSP which will be created by the servlet container. usually, if we want to access any data in a class, we have to create an object using new operator and then access the methods on that object. for implicit objects, we can use them directly on JSP pages.

JSP is used in MVC model architecture soi will clearly separate presentation logic with model logic. JSP used as presentation logic which we can use the objects without creating the instances.

In servlets API, we have to create the objects, calls the methods on the objects. but to use the servlet specific information in JSP, implicit object can be used without creating an object.

This post is  part of j2ee tutorials in my blog

1.request 2.response,session,application 4.pageContext 5.config 6.exception 7.out

request implicit Objects

request scope is similar to HttpServletRequest object which holds request specific information. request object in jsp is equal to HttpServlet in servlets. rethe quest object is used to persist the request scope parameters and reqeust meta header information like

response implicit Objects

response is an similar to HttpServletResponse object in a servlet. Response object holds the information returned to the client. This object holds cookies, content and type and http header

Page implicit Objects

page indicates current jsp page and has the scope of jsp page execution

Session implicit Objects

The session object is HttpSession class in Servlets. Session holds personalized data of a user. In a real scenarios, Session object is created one for each user

application implicit Objects:- application is a global object similar to in Servlets. application objects hold information about web application and only one application for each web application

PageContext implicit Objects

 jsp pageContext is object of PageContext in servlets.

Config implicit Objects

 Jsp config is an instance of ServletConfig class. which holds configuration parameters at servlet level.

Web application can have Config objects in such way that each servlet only one config objects.

Exception implicit Objects

 Exception object is an instance of the Throwable class.

Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
You'll get a notification every time a post gets published here.