Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

JSP Implicit Objects


There are 9 jsp implicit objects. These objects are created by the web container that are available to all the jsp pages.

The available implicit objects are out, request, config, session, application etc.

A list of the 9 implicit objects is given below:

Object Type
out JspWriter
request HttpServletRequest
response HttpServletResponse
config ServletConfig
application ServletContext
session HttpSession
pageContext PageContext
page Object
exception Throwable

1) JSP out implicit object

For writing any data to the buffer, JSP provides an implicit object named out. It is the object of JspWriter. In case of servlet you need to write:

  1. PrintWriter out=response.getWriter();

But in JSP, you don’t need to write this code.


Example of out implicit object

In this example we are simply displaying date and time.

index.jsp

  1. <html>
  2. <body>
  3. <% out.print(“Today is:”+java.util.Calendar.getInstance().getTime()); %>
  4. </body>
  5. </html>

Output

out

Comments

comments