SlideShare a Scribd company logo
JSP config implicit object
Prof. Neeraj Bhargava
Kapil Chauhan
Department of Computer Science
School of Engineering & Systems Sciences
MDS University, Ajmer
JSP config implicit object
 In JSP, config is an implicit object type ServletConfig.
 This object can be used to get initialization parameter
for a particular JSP page.
 The config object is created by the web container for
each jsp page.
Cont..
 Generally, it is used to get initialization parameter
from the web.xml file.
Example of config implicit object:
 index.html
 <form action="welcome">
 <input type="text" name="uname">
 <input type="submit" value="go"><br/>
 </form>
Cont..
 web.xml file
 <web-app>

 <servlet>
 <servlet-name>sonoojaiswal</servlet-name>
 <jsp-file>/welcome.jsp</jsp-file>

 <init-param>
 <param-name>dname</param-name>
 <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
 </init-param>

 </servlet>

 <servlet-mapping>
 <servlet-name>sonoojaiswal</servlet-name>
 <url-pattern>/welcome</url-pattern>
 </servlet-mapping>

 </web-app>
Cont..
 welcome.jsp
 <%
 out.print("Welcome "+request.getParameter("uname")
);

 String driver=config.getInitParameter("dname");
 out.print("driver name is="+driver);
 %>
Output
Output
Assignment
 Explain JSP config implicit object with suitable
example.

More Related Content

What's hot (19)

PPT
KMUTNB - Internet Programming 5/7
phuphax
 
PDF
Introduction to AngularJS For WordPress Developers
Caldera Labs
 
PDF
Introduction to AJAX In WordPress
Caldera Labs
 
PDF
React.js触ってみた 吉澤和香奈
Wakana Yoshizawa
 
PDF
Thymeleaf Introduction
Anthony Chen
 
PPTX
`From Prototype to Drupal` by Andrew Ivasiv
Lemberg Solutions
 
PPTX
Webinar: AngularJS and the WordPress REST API
WP Engine UK
 
PPTX
Let's react - Meetup
RAJNISH KATHAROTIYA
 
PDF
AngularJS Data Binding
Ticore Shih
 
PPTX
Dart and AngularDart
Loc Nguyen
 
PDF
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Caldera Labs
 
PPTX
Why angular js Framework
Sakthi Bro
 
PPTX
Ch2(working with forms)
Chhom Karath
 
PDF
Intro To Mvc Development In Php
funkatron
 
PPTX
Introduction to java_script
Basavaraj Hampali
 
PDF
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
PDF
Introducing thymeleaf
eiryu
 
PDF
AngularJS introduction
Tania Gonzales
 
KMUTNB - Internet Programming 5/7
phuphax
 
Introduction to AngularJS For WordPress Developers
Caldera Labs
 
Introduction to AJAX In WordPress
Caldera Labs
 
React.js触ってみた 吉澤和香奈
Wakana Yoshizawa
 
Thymeleaf Introduction
Anthony Chen
 
`From Prototype to Drupal` by Andrew Ivasiv
Lemberg Solutions
 
Webinar: AngularJS and the WordPress REST API
WP Engine UK
 
Let's react - Meetup
RAJNISH KATHAROTIYA
 
AngularJS Data Binding
Ticore Shih
 
Dart and AngularDart
Loc Nguyen
 
Single Page Web Apps As WordPress Admin Interfaces Using AngularJS & The Word...
Caldera Labs
 
Why angular js Framework
Sakthi Bro
 
Ch2(working with forms)
Chhom Karath
 
Intro To Mvc Development In Php
funkatron
 
Introduction to java_script
Basavaraj Hampali
 
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Introducing thymeleaf
eiryu
 
AngularJS introduction
Tania Gonzales
 

More from chauhankapil (20)

PPTX
Gray level transformation
chauhankapil
 
PPTX
Elements of visual perception
chauhankapil
 
PPTX
JSP Client Request
chauhankapil
 
PPTX
Jsp server response
chauhankapil
 
PPTX
Markov decision process
chauhankapil
 
PPTX
RNN basics in deep learning
chauhankapil
 
PPTX
Introduction to generative adversarial networks (GANs)
chauhankapil
 
PPTX
Bayesian probabilistic interference
chauhankapil
 
PPTX
Jsp
chauhankapil
 
PPTX
Exception handling in java
chauhankapil
 
PPTX
Knowledge acquistion
chauhankapil
 
PPTX
Knowledge based system
chauhankapil
 
PPTX
Introduction of predicate logics
chauhankapil
 
PPTX
Types of inheritance in java
chauhankapil
 
PPTX
Representation of syntax, semantics and Predicate logics
chauhankapil
 
PPTX
Inheritance in java
chauhankapil
 
PPTX
Propositional logic
chauhankapil
 
PPTX
Constructors in java
chauhankapil
 
PPTX
Methods in java
chauhankapil
 
PPT
Circular linked list
chauhankapil
 
Gray level transformation
chauhankapil
 
Elements of visual perception
chauhankapil
 
JSP Client Request
chauhankapil
 
Jsp server response
chauhankapil
 
Markov decision process
chauhankapil
 
RNN basics in deep learning
chauhankapil
 
Introduction to generative adversarial networks (GANs)
chauhankapil
 
Bayesian probabilistic interference
chauhankapil
 
Exception handling in java
chauhankapil
 
Knowledge acquistion
chauhankapil
 
Knowledge based system
chauhankapil
 
Introduction of predicate logics
chauhankapil
 
Types of inheritance in java
chauhankapil
 
Representation of syntax, semantics and Predicate logics
chauhankapil
 
Inheritance in java
chauhankapil
 
Propositional logic
chauhankapil
 
Constructors in java
chauhankapil
 
Methods in java
chauhankapil
 
Circular linked list
chauhankapil
 
Ad

Recently uploaded (20)

PPTX
ENSA_Module_8.pptx_nice_ipsec_presentation
RanaMukherjee24
 
PPTX
Electron Beam Machining for Production Process
Rajshahi University of Engineering & Technology(RUET), Bangladesh
 
PPTX
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
PDF
Lecture Information Theory and CodingPart-1.pdf
msc9219
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PPTX
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PDF
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
PPTX
Abstract Data Types (ADTs) in Data Structures
mwaslam2303
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PPTX
Mining Presentation Underground - Copy.pptx
patallenmoore
 
PDF
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
PPT
04 Origin of Evinnnnnnnnnnnnnnnnnnnnnnnnnnl-notes.ppt
LuckySangalala1
 
PPTX
Data_Analytics_Presentation_By_Malik_Azanish_Asghar.pptx
azanishmalik1
 
PPTX
drones for disaster prevention response.pptx
NawrasShatnawi1
 
PDF
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PPTX
Cyclic_Redundancy_Check_Presentation.pptx
alhjranyblalhmwdbdal
 
PDF
Comparative Analysis of the Use of Iron Ore Concentrate with Different Binder...
msejjournal
 
PPTX
111111111111111111111111111111111111111111.pptx
sppatelrs
 
PDF
mosfet introduction engg topic for students.pdf
trsureshkumardata
 
ENSA_Module_8.pptx_nice_ipsec_presentation
RanaMukherjee24
 
Electron Beam Machining for Production Process
Rajshahi University of Engineering & Technology(RUET), Bangladesh
 
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
Lecture Information Theory and CodingPart-1.pdf
msc9219
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
ISO/IEC JTC 1/WG 9 (MAR) Convenor Report
Kurata Takeshi
 
PRIZ Academy - Change Flow Thinking Master Change with Confidence.pdf
PRIZ Guru
 
Abstract Data Types (ADTs) in Data Structures
mwaslam2303
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Mining Presentation Underground - Copy.pptx
patallenmoore
 
MOBILE AND WEB BASED REMOTE BUSINESS MONITORING SYSTEM
ijait
 
04 Origin of Evinnnnnnnnnnnnnnnnnnnnnnnnnnl-notes.ppt
LuckySangalala1
 
Data_Analytics_Presentation_By_Malik_Azanish_Asghar.pptx
azanishmalik1
 
drones for disaster prevention response.pptx
NawrasShatnawi1
 
Unified_Cloud_Comm_Presentation anil singh ppt
anilsingh298751
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
Cyclic_Redundancy_Check_Presentation.pptx
alhjranyblalhmwdbdal
 
Comparative Analysis of the Use of Iron Ore Concentrate with Different Binder...
msejjournal
 
111111111111111111111111111111111111111111.pptx
sppatelrs
 
mosfet introduction engg topic for students.pdf
trsureshkumardata
 
Ad

Jsp config implicit object

  • 1. JSP config implicit object Prof. Neeraj Bhargava Kapil Chauhan Department of Computer Science School of Engineering & Systems Sciences MDS University, Ajmer
  • 2. JSP config implicit object  In JSP, config is an implicit object type ServletConfig.  This object can be used to get initialization parameter for a particular JSP page.  The config object is created by the web container for each jsp page.
  • 3. Cont..  Generally, it is used to get initialization parameter from the web.xml file.
  • 4. Example of config implicit object:  index.html  <form action="welcome">  <input type="text" name="uname">  <input type="submit" value="go"><br/>  </form>
  • 5. Cont..  web.xml file  <web-app>   <servlet>  <servlet-name>sonoojaiswal</servlet-name>  <jsp-file>/welcome.jsp</jsp-file>   <init-param>  <param-name>dname</param-name>  <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>  </init-param>   </servlet>   <servlet-mapping>  <servlet-name>sonoojaiswal</servlet-name>  <url-pattern>/welcome</url-pattern>  </servlet-mapping>   </web-app>
  • 6. Cont..  welcome.jsp  <%  out.print("Welcome "+request.getParameter("uname") );   String driver=config.getInitParameter("dname");  out.print("driver name is="+driver);  %>
  • 9. Assignment  Explain JSP config implicit object with suitable example.