1 of 7

ADVANCED JAVA PROGRAMMING

Implicit Objects in JSP

Smt M.Jeevana Sujitha

Assistant Professor

Department of Computer Science and Engineering

SRKR Engineering College, Bhimavaram, A.P. - 534204

2 of 7

OBJECTIVES

The Objective of this lecture is

  • To learn about Implicit Objects in JSP.

3 of 7

Implicit Objects in JSP

  • JSP implicit objects are predefined objects that are

accessible to all JSP pages.

  • JSP implicit objects are used to make the page dynamic.
  • The JSP container automatically instantiates these objects while writing the script content in the scriptlet and expression tags.

Types of implicit objects:

  • Request
  • Response
  • Application
  • Session
  • Config
  • Exception
  • Out

4 of 7

Implicit Objects in JSP

Request: Request objects are passed as parameters to the JSP service() method when a client request is made.

Example:

request.getParameter(“i/p control name”); Response: The response object is used to

carry the response of a client request after service() method is executed.

Example:

response.setContentType(“text/html”);

5 of 7

Implicit Objects in JSP

Application: This object provides the resources shared with in a web application.

Example: application.getServerinfo();

Session: This variable is used to access the current client session.

Example: session.setAttribute(); session.getAttribute();

6 of 7

Implicit Objects in JSP

Config: It helps in passing the information to servlet or JSP page during initialization.

Example: config.getServletName();

Exception: This object is for handling error pages and contain information about runtime error.

Out: It is used to call the methods related to I/O.

Example:

out.println(“welcome to JSP world”);

7 of 7

THANK YOU