SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Implicit Objects
Advance Java
(2160707)
Prepared By::
Metaliya Darshit (130110107020)
INTRODUCTION
JSP Implicit Objects are the Java objects that the JSP Container
makes available to developers in each page and developer can
call them directly without being explicitly declared.
JSP Implicit Objects are also called pre-defined variables.
Object Description
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 send output to the client.
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.
REQUEST OBJECT
Implicit object of type HttpServletRequest i.e. created for each
jsp request by the web container.
Use:
To get request information such as parameter, header
information, remote address, server name, server port,
content type, character encoding
To set, get and remove attributes from the jsp request
scope.
REQUEST OBJECT
Index.html
<form action="welcome.jsp">
<input type="text" name="uname">
<input type="submit" value="go"><br/>
</form>
Newjsp.jsp
<%
String name=request.getParameter("uname");
out.print("welcome "+name);
%>
RESPONSE OBJECT
Implicit object of type HttpServletResponse. The instance of
HttpServletResponse is created by the web container for each
jsp request.
Defines the interfaces that deal with creating new HTTP
headers. Through this object the JSP programmer can add new
cookies or date stamps, HTTP status codes etc.
Use:
To add or manipulate response such as redirect response
to another resource, send error etc.
Newjsp.jsp
<%
response.sendRedirect("http://www.google.com");
OUT OBJECT
Instance of a javax.servlet.jsp.JspWriter object and is used to
send content in a response.
Use:
For writing any data to the buffer
displaying dynamic data
The java way to display text on the webpage
Newjsp.jsp
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime());
%>
SESSION OBJECT
implicit object of type HttpSession.
Use:
to set, get or remove attribute or to get session
information.
to track client session between client requests
SESSION OBJECT
Index.html
<form action="welcome.jsp">
<input type="text" name="uname">
<input type="submit" value="go"><br/>
</form>
Newjsp.jsp
<%
String name=request.getParameter("uname");
out.print("Welcome "+name);
session.setAttribute("user",name);
%><a href="second.jsp">second jsp page</a>
SESSION OBJECT
second.jsp
<%
String name=(String)session.getAttribute("user");
out.print("Hello "+name);
%>
APPLICATION OBJECT
Implicit object of type ServletContext.
Instance of ServletContext is created only once by the web
container when application or project is deployed on the server.
Use
To get initialization parameter from configuaration file
(web.xml).
To get, set or remove attribute from the application scope.
APPLICATION OBJECT
Newjsp.jsp
<%
out.print("Welcome "+request.getParameter("uname"));
String driver=application.getInitParameter("dname");
out.print("driver name is="+driver);
%>
CONFIG OBJECT
Implicit object of type ServletConfig.
Use:
To get initialization parameter for a particular JSP page
Allows the JSP programmer access to the Servlet or JSP
engine initialization parameters such as the paths or file
locations etc.
CONFIG OBJECT
PAGECONTEXT OBJECT
Implicit object of type PageContext class
Intended as a means to access information about the page
while avoiding most of the implementation details.
Use:
To set, get or remove attribute from one of the following
scopes:
page
request
session
Application
In JSP, page scope is the default scope.
PAGECONTEXT OBJECT
Newjsp.jsp
<%
String name=request.getParameter("uname");
out.print("Welcome "+name);
pageContext.setAttribute("user",name,PageContext.SESSION_SC
OPE); %>
<a href="second.jsp">second jsp page</a>
PAGECONTEXT OBJECT
second.jsp
<%
String name=(String)pageContext.getAttribute("user",PageContext.SES
SION_SCOPE);
out.print("Hello "+name);
%>
PAGE OBJECT
An actual reference to the instance of the page.
It can be thought of as an object that represents the entire JSP
page.
implicit object of type java.lang.Throwable class.
The exception object is a wrapper containing the exception
thrown from the previous page. It is typically used to generate
an appropriate response to the error condition.
EXCEPTION OBJECT
implicit object of type java.lang.Throwable class.
A wrapper containing the exception thrown from the previous
page.
Use:
To generate an appropriate response to the error
condition.
Implicit objects advance Java

More Related Content

What's hot (20)

PPTX
Inner classes in java
PhD Research Scholar
 
PDF
3.2 javascript regex
Jalpesh Vasa
 
PPS
String and string buffer
kamal kotecha
 
PDF
jQuery Essentials
Marc Grabanski
 
PPT
Java awt
Arati Gadgil
 
PDF
Java Collections Tutorials
Prof. Erwin Globio
 
PPTX
Event handling
swapnac12
 
PDF
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
PPT
Swing and AWT in java
Adil Mehmoood
 
PPT
Java collections concept
kumar gaurav
 
PPT
Server Controls of ASP.Net
Hitesh Santani
 
PDF
Php array
Nikul Shah
 
PPTX
Java Server Pages(jsp)
Manisha Keim
 
PDF
Asynchronous JavaScript Programming
Haim Michael
 
PDF
Collections In Java
Binoj T E
 
PPT
PHP variables
Siddique Ibrahim
 
PPT
Oops concepts in php
CPD INDIA
 
PPTX
Event Handling in Java
Ayesha Kanwal
 
PPTX
Chapter 3 servlet & jsp
Jafar Nesargi
 
Inner classes in java
PhD Research Scholar
 
3.2 javascript regex
Jalpesh Vasa
 
String and string buffer
kamal kotecha
 
jQuery Essentials
Marc Grabanski
 
Java awt
Arati Gadgil
 
Java Collections Tutorials
Prof. Erwin Globio
 
Event handling
swapnac12
 
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Swing and AWT in java
Adil Mehmoood
 
Java collections concept
kumar gaurav
 
Server Controls of ASP.Net
Hitesh Santani
 
Php array
Nikul Shah
 
Java Server Pages(jsp)
Manisha Keim
 
Asynchronous JavaScript Programming
Haim Michael
 
Collections In Java
Binoj T E
 
PHP variables
Siddique Ibrahim
 
Oops concepts in php
CPD INDIA
 
Event Handling in Java
Ayesha Kanwal
 
Chapter 3 servlet & jsp
Jafar Nesargi
 

Viewers also liked (8)

PPT
Active x
andrew20827
 
PPS
Jsp chapter 1
kamal kotecha
 
PPT
Active x control
Amandeep Kaur
 
PPT
Active server pages
mcatahir947
 
PPS
Jsp element
kamal kotecha
 
PPTX
Introduction ASP
FaTin GhaZmi
 
PPT
Active Server Page(ASP)
Keshab Nath
 
PPTX
Client side scripting and server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
Active x
andrew20827
 
Jsp chapter 1
kamal kotecha
 
Active x control
Amandeep Kaur
 
Active server pages
mcatahir947
 
Jsp element
kamal kotecha
 
Introduction ASP
FaTin GhaZmi
 
Active Server Page(ASP)
Keshab Nath
 
Client side scripting and server side scripting
baabtra.com - No. 1 supplier of quality freshers
 
Ad

Similar to Implicit objects advance Java (20)

PPT
Jsp
Manav Prasad
 
DOC
Jsp advance part i
sameersaxena90
 
PPTX
Java server pages
Farzad Wadia
 
PPT
Server side development on java server pages
vinitasharma749430
 
PPTX
Advance java session 11
Smita B Kumar
 
PDF
JSP TUTORIAL for students M.Sc computer Science
godjanuwadde90
 
PPTX
Jsp session 3
Anuj Singh Rajput
 
PPTX
Jsp request implicit object
chauhankapil
 
PPTX
Implicit Objects &Handling.pptx
KSuvetha1
 
PPTX
JSP Directives IMPLICIT ACTIONS and HACKING.pptx
yvtinsane
 
PPTX
Introduction to JSP.pptx
ManishaPatil932723
 
PDF
Lap trinh web [Slide jsp]
Tri Nguyen
 
PPTX
Jsp session implicit object
chauhankapil
 
PPTX
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
DOC
Jsp
Rahul Goyal
 
DOC
Jsp
Rahul Goyal
 
PDF
Servlet., tomcat server, implicit jsp object
ADITYADIXIT974283
 
PPTX
WT Unit-Vuufvmjn dissimilating Dunkirk k
asta9578
 
Jsp advance part i
sameersaxena90
 
Java server pages
Farzad Wadia
 
Server side development on java server pages
vinitasharma749430
 
Advance java session 11
Smita B Kumar
 
JSP TUTORIAL for students M.Sc computer Science
godjanuwadde90
 
Jsp session 3
Anuj Singh Rajput
 
Jsp request implicit object
chauhankapil
 
Implicit Objects &Handling.pptx
KSuvetha1
 
JSP Directives IMPLICIT ACTIONS and HACKING.pptx
yvtinsane
 
Introduction to JSP.pptx
ManishaPatil932723
 
Lap trinh web [Slide jsp]
Tri Nguyen
 
Jsp session implicit object
chauhankapil
 
Jsp Introduction Tutorial
APSMIND TECHNOLOGY PVT LTD.
 
Servlet., tomcat server, implicit jsp object
ADITYADIXIT974283
 
WT Unit-Vuufvmjn dissimilating Dunkirk k
asta9578
 
Ad

Recently uploaded (20)

PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
PPTX
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
PPTX
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
Big Data and Data Science hype .pptx
SUNEEL37
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
PPTX
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PPTX
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
Electrical Engineer operation Supervisor
ssaruntatapower143
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
Worm gear strength and wear calculation as per standard VB Bhandari Databook.
shahveer210504
 
What is Shot Peening | Shot Peening is a Surface Treatment Process
Vibra Finish
 
Lecture 1 Shell and Tube Heat exchanger-1.pptx
mailforillegalwork
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Big Data and Data Science hype .pptx
SUNEEL37
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
Damage of stability of a ship and how its change .pptx
ehamadulhaque
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
GitOps_Without_K8s_Training_detailed git repository
DanialHabibi2
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
Electrical Engineer operation Supervisor
ssaruntatapower143
 

Implicit objects advance Java

  • 1. Implicit Objects Advance Java (2160707) Prepared By:: Metaliya Darshit (130110107020)
  • 2. INTRODUCTION JSP Implicit Objects are the Java objects that the JSP Container makes available to developers in each page and developer can call them directly without being explicitly declared. JSP Implicit Objects are also called pre-defined variables.
  • 3. Object Description 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 send output to the client. 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.
  • 4. REQUEST OBJECT Implicit object of type HttpServletRequest i.e. created for each jsp request by the web container. Use: To get request information such as parameter, header information, remote address, server name, server port, content type, character encoding To set, get and remove attributes from the jsp request scope.
  • 5. REQUEST OBJECT Index.html <form action="welcome.jsp"> <input type="text" name="uname"> <input type="submit" value="go"><br/> </form> Newjsp.jsp <% String name=request.getParameter("uname"); out.print("welcome "+name); %>
  • 6. RESPONSE OBJECT Implicit object of type HttpServletResponse. The instance of HttpServletResponse is created by the web container for each jsp request. Defines the interfaces that deal with creating new HTTP headers. Through this object the JSP programmer can add new cookies or date stamps, HTTP status codes etc. Use: To add or manipulate response such as redirect response to another resource, send error etc. Newjsp.jsp <% response.sendRedirect("http://www.google.com");
  • 7. OUT OBJECT Instance of a javax.servlet.jsp.JspWriter object and is used to send content in a response. Use: For writing any data to the buffer displaying dynamic data The java way to display text on the webpage Newjsp.jsp <% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
  • 8. SESSION OBJECT implicit object of type HttpSession. Use: to set, get or remove attribute or to get session information. to track client session between client requests
  • 9. SESSION OBJECT Index.html <form action="welcome.jsp"> <input type="text" name="uname"> <input type="submit" value="go"><br/> </form> Newjsp.jsp <% String name=request.getParameter("uname"); out.print("Welcome "+name); session.setAttribute("user",name); %><a href="second.jsp">second jsp page</a>
  • 11. APPLICATION OBJECT Implicit object of type ServletContext. Instance of ServletContext is created only once by the web container when application or project is deployed on the server. Use To get initialization parameter from configuaration file (web.xml). To get, set or remove attribute from the application scope.
  • 12. APPLICATION OBJECT Newjsp.jsp <% out.print("Welcome "+request.getParameter("uname")); String driver=application.getInitParameter("dname"); out.print("driver name is="+driver); %>
  • 13. CONFIG OBJECT Implicit object of type ServletConfig. Use: To get initialization parameter for a particular JSP page Allows the JSP programmer access to the Servlet or JSP engine initialization parameters such as the paths or file locations etc.
  • 15. PAGECONTEXT OBJECT Implicit object of type PageContext class Intended as a means to access information about the page while avoiding most of the implementation details. Use: To set, get or remove attribute from one of the following scopes: page request session Application In JSP, page scope is the default scope.
  • 16. PAGECONTEXT OBJECT Newjsp.jsp <% String name=request.getParameter("uname"); out.print("Welcome "+name); pageContext.setAttribute("user",name,PageContext.SESSION_SC OPE); %> <a href="second.jsp">second jsp page</a>
  • 18. PAGE OBJECT An actual reference to the instance of the page. It can be thought of as an object that represents the entire JSP page. implicit object of type java.lang.Throwable class. The exception object is a wrapper containing the exception thrown from the previous page. It is typically used to generate an appropriate response to the error condition.
  • 19. EXCEPTION OBJECT implicit object of type java.lang.Throwable class. A wrapper containing the exception thrown from the previous page. Use: To generate an appropriate response to the error condition.