SlideShare a Scribd company logo
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
Ad

More Related Content

What's hot (20)

ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
habib_786
 
jQuery
jQueryjQuery
jQuery
Mohammed Arif
 
What is Ajax technology?
What is Ajax technology?What is Ajax technology?
What is Ajax technology?
JavaTpoint.Com
 
Ajax presentation
Ajax presentationAjax presentation
Ajax presentation
Bharat_Kumawat
 
jQuery
jQueryjQuery
jQuery
Jay Poojara
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
VMahesh5
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
Emprovise
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
Jeevesh Pandey
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
Hùng Nguyễn Huy
 
Selenium Locators
Selenium LocatorsSelenium Locators
Selenium Locators
Satyam Pandey
 
Servlet and servlet life cycle
Servlet and servlet life cycleServlet and servlet life cycle
Servlet and servlet life cycle
Dhruvin Nakrani
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
Eyal Vardi
 
Jsp presentation
Jsp presentationJsp presentation
Jsp presentation
Sher Singh Bardhan
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
Vikas Jagtap
 
What Is Express JS?
What Is Express JS?What Is Express JS?
What Is Express JS?
Simplilearn
 
Ajax ppt
Ajax pptAjax ppt
Ajax ppt
OECLIB Odisha Electronics Control Library
 
Hibernate - Part 1
Hibernate - Part 1Hibernate - Part 1
Hibernate - Part 1
Hitesh-Java
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
Jennifer Estrada
 
Intro to React
Intro to ReactIntro to React
Intro to React
Justin Reock
 

Viewers also liked (8)

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

Similar to Implicit objects advance Java (20)

Jsp session implicit object
Jsp session implicit objectJsp session implicit object
Jsp session implicit object
chauhankapil
 
J2EE jsp_03
J2EE jsp_03J2EE jsp_03
J2EE jsp_03
Biswabrata Banerjee
 
JSP.pptx programming guide for beginners and experts
JSP.pptx programming guide for beginners and expertsJSP.pptx programming guide for beginners and experts
JSP.pptx programming guide for beginners and experts
rani marri
 
4. jsp
4. jsp4. jsp
4. jsp
AnusAhmad
 
Web&java. jsp
Web&java. jspWeb&java. jsp
Web&java. jsp
Asya Dudnik
 
Web&java. jsp
Web&java. jspWeb&java. jsp
Web&java. jsp
Asya Dudnik
 
Jsp session 3
Jsp   session 3Jsp   session 3
Jsp session 3
Anuj Singh Rajput
 
Jsp1
Jsp1Jsp1
Jsp1
Soham Sengupta
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
Vipin Yadav
 
Jsp advance part i
Jsp advance part iJsp advance part i
Jsp advance part i
sameersaxena90
 
Lap trinh web [Slide jsp]
Lap trinh web [Slide jsp]Lap trinh web [Slide jsp]
Lap trinh web [Slide jsp]
Tri Nguyen
 
Introduction to JSP.pptx
Introduction to JSP.pptxIntroduction to JSP.pptx
Introduction to JSP.pptx
ManishaPatil932723
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
Geethu Mohan
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
Smita B Kumar
 
ADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages TechnologyADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages Technology
Riza Nurman
 
Atul & shubha goswami jsp
Atul & shubha goswami jspAtul & shubha goswami jsp
Atul & shubha goswami jsp
Atul Giri
 
J2EE jsp_01
J2EE jsp_01J2EE jsp_01
J2EE jsp_01
Biswabrata Banerjee
 
JSP Components and Directives.pdf
JSP Components and Directives.pdfJSP Components and Directives.pdf
JSP Components and Directives.pdf
Arumugam90
 
Request dispacther interface ppt
Request dispacther interface pptRequest dispacther interface ppt
Request dispacther interface ppt
Taha Malampatti
 
Jsp session implicit object
Jsp session implicit objectJsp session implicit object
Jsp session implicit object
chauhankapil
 
JSP.pptx programming guide for beginners and experts
JSP.pptx programming guide for beginners and expertsJSP.pptx programming guide for beginners and experts
JSP.pptx programming guide for beginners and experts
rani marri
 
JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
Vipin Yadav
 
Lap trinh web [Slide jsp]
Lap trinh web [Slide jsp]Lap trinh web [Slide jsp]
Lap trinh web [Slide jsp]
Tri Nguyen
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
Geethu Mohan
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
Talha Ocakçı
 
Advance java session 11
Advance java session 11Advance java session 11
Advance java session 11
Smita B Kumar
 
ADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages TechnologyADP - Chapter 5 Exploring JavaServer Pages Technology
ADP - Chapter 5 Exploring JavaServer Pages Technology
Riza Nurman
 
Atul & shubha goswami jsp
Atul & shubha goswami jspAtul & shubha goswami jsp
Atul & shubha goswami jsp
Atul Giri
 
JSP Components and Directives.pdf
JSP Components and Directives.pdfJSP Components and Directives.pdf
JSP Components and Directives.pdf
Arumugam90
 
Request dispacther interface ppt
Request dispacther interface pptRequest dispacther interface ppt
Request dispacther interface ppt
Taha Malampatti
 
Ad

Recently uploaded (20)

QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........
jinny kaur
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
Building Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdfBuilding Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdf
rabiaatif2
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Gas Power Plant for Power Generation System
Gas Power Plant for Power Generation SystemGas Power Plant for Power Generation System
Gas Power Plant for Power Generation System
JourneyWithMe1
 
QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)QA/QC Manager (Quality management Expert)
QA/QC Manager (Quality management Expert)
rccbatchplant
 
BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........BTech_CSE_LPU_Presentation.pptx.........
BTech_CSE_LPU_Presentation.pptx.........
jinny kaur
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
Building Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdfBuilding Security Systems in Architecture.pdf
Building Security Systems in Architecture.pdf
rabiaatif2
 
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis""Heaters in Power Plants: Types, Functions, and Performance Analysis"
"Heaters in Power Plants: Types, Functions, and Performance Analysis"
Infopitaara
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
introduction to machine learining for beginers
introduction to machine learining for beginersintroduction to machine learining for beginers
introduction to machine learining for beginers
JoydebSheet
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
Gas Power Plant for Power Generation System
Gas Power Plant for Power Generation SystemGas Power Plant for Power Generation System
Gas Power Plant for Power Generation System
JourneyWithMe1
 

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.