SlideShare a Scribd company logo
Jeetrainers.com coursejspservlets00
Servlet / JSP course topics
•   Chapter 0 Introduction to Java Web Development
•   Chapter 1 Introduction to servlets
•   Chapter 2 Introduction to JavaServer Pages
•   Chapter 3 How to use the MVC pattern in a Java Web Application
•   Chapter 4 How to share information in servlets and JSPs
•   Chapter 5 Advanced JSP concepts
•   Chapter 6 How to use JavaBeans with JSP
•   Chapter 7 How to use the JSP Expression Language (EL)
•   Chapter 8 How to use the JSP Standard Tag Library (JSTL)
•   Chapter 9 How to use custom JSP tags
•   Chapter 10 How to access databases in java web applications
•   Chapter 11 How to use JavaMail to send email
•   Chapter 12 How to secure java web applications
•   Chapter 13 How to download files with Servlets
•   Chapter 14 How to work with listeners
•   Chapter 15 How to work with filters
Introduction to
Java Web Development
Introduction to Java Web
                Development
•   Java Enterprise Edition
•   Java Web Development
•   Structure of a web project
•   Introduction to Web Applications
•   The first project
Java Enterprise Edition
Java Web Development




* Note
In this course only JSP & servlets will be discussed
Structure of a web project
• There are two kind of structures
   – The structure of the web application in a server
   – The structure of the IDE

• A web project have three main elements
   – The JSPs files
   – The java classes
   – The Configuration file web.xml
Structure of a web project
       in the server
Structure of a web project
       in the server
                       Root of the project



                      Java classes (.class)

                      Java Libraries (.jar)

                      Configuration files

                      Anything web-related
                      - Directories
                      - JavaServer Pages (JSP)
                      - HTML
                      - Css files
                      - JavaScript Files
                      - Etc.
Introduction to Web Applications
• In a Web Application, web components provide the dynamic
  extension capabilities for a web server.
• Web components can be Java servlets, JSP pages, or web
  service endpoints.
• The interaction between a web client and a web application is
  explained and illustrated in the next slide figure.
   – The client sends an HTTP request to the web server.
   – A web server that implements Java Servlet and JavaServer Pages
     technology converts the request into an HTTPServletRequest object.
   – This object is delivered to a web component, which can interact with
     JavaBeans components or a database to generate dynamic content.
   – The web component can then generate an HTTPServletResponse or it
     can pass the request to another web component.
   – Eventually a web component generates a HTTPServletResponse
     object. The web server converts this object to an HTTP response and
     returns it to the client.
Introduction to Web Applications
Introduction to Web Applications
• Servlets are Java programming language classes that
  dynamically process requests and construct responses. 
• JSP pages are text-based documents that execute as servlets
  but allow a more natural approach to creating static content.
• Although servlets and JSP pages can be used interchangeably,
  each has its own strengths.
• Servlets are best suited for service-oriented applications (web
  service endpoints are implemented as servlets) and the
  control functions of a presentation-oriented application, such
  as dispatching requests and handling nontextual data.
• JSP pages are more appropriate for generating text-based
  markup such as HTML, Scalable Vector Graphics (SVG),
  Wireless Markup Language (WML), and XML.
Servlets versus JSP
Life Cycle of a
JEE Web Application
Life Cycle of a
JEE Web Application
Criteria to develop web applications
Exercise 1
•      Develope the first java web
       application
1.     Download the file:
     jspservlet-00.zip
1.     Unzip it
2.     Import from Eclipse
3.     Run it
Exercise 1
                  Results
• You should get this result
Exercise 1
                                Analisis
• The web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" . . . version="2.5">

  <servlet>
    <display-name>HelloWorldServlet</display-name>
    <servlet-name>HelloWorldServlet</servlet-name>
    <servlet-class>
        com.example.servlets.HelloWorldServlet
    </servlet-class>
  </servlet>                                                               Servlet
  <servlet>                                                              declarations
    <display-name>AnotherServlet</display-name>
    <servlet-name>AnotherServlet</servlet-name>
    <servlet-class>
        com.example.servlets.AnotherServlet
    </servlet-class>
  </servlet>
Exercise 1
                      Analisis
• The web.xml file
. . .
  <servlet-mapping>
    <servlet-name>HelloWorldServlet</servlet-name>
    <url-pattern>/HelloWorldServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AnotherServlet</servlet-name>       Servlet
    <url-pattern>/AnotherServlet</url-pattern>       mappings
  </servlet-mapping>
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
  </welcome-file-list>
</web-app>
Exercise 1
 Analisis

        Servlet classes
        (other might be here classes too)




        Other resources might be here

More Related Content

What's hot (19)

PDF
Java colombo-deep-dive-into-jax-rs
Sagara Gunathunga
 
PPTX
Alfresco Mvc - a seamless integration with Spring Mvc
Daniel Gradecak
 
PPTX
Client server 01
Lockey Irawan
 
PPTX
Jsp basic
Jaya Kumari
 
PPTX
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
Aaqib Hussain
 
PPTX
Java Server Pages
Kasun Madusanke
 
PPTX
Java Server Pages(jsp)
Manisha Keim
 
PPT
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
JavaEE Trainers
 
PDF
Jive the renovation of Aswing
antopensource
 
PPT
Maven introduction in Mule
Shahid Shaik
 
PPTX
Java
PriyaKarnan3
 
PPT
weblogic training | oracle weblogic online training | weblogic server course
Nancy Thomas
 
PPT
Introduction to the Servlet / JSP course
JavaEE Trainers
 
PPT
Jsp Comparison
Venky Sadasivam
 
PPTX
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
turgaysahtiyan
 
PPT
Jsp(java server pages)
Khan Mac-arther
 
PDF
Web a Quebec - JS Debugging
Rami Sayar
 
PDF
J2EE_Course_Content
MV Solutions
 
PDF
SpringPeople Introduction to MongoDB Administration
SpringPeople
 
Java colombo-deep-dive-into-jax-rs
Sagara Gunathunga
 
Alfresco Mvc - a seamless integration with Spring Mvc
Daniel Gradecak
 
Client server 01
Lockey Irawan
 
Jsp basic
Jaya Kumari
 
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
Aaqib Hussain
 
Java Server Pages
Kasun Madusanke
 
Java Server Pages(jsp)
Manisha Keim
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
JavaEE Trainers
 
Jive the renovation of Aswing
antopensource
 
Maven introduction in Mule
Shahid Shaik
 
weblogic training | oracle weblogic online training | weblogic server course
Nancy Thomas
 
Introduction to the Servlet / JSP course
JavaEE Trainers
 
Jsp Comparison
Venky Sadasivam
 
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
turgaysahtiyan
 
Jsp(java server pages)
Khan Mac-arther
 
Web a Quebec - JS Debugging
Rami Sayar
 
J2EE_Course_Content
MV Solutions
 
SpringPeople Introduction to MongoDB Administration
SpringPeople
 

Similar to Jeetrainers.com coursejspservlets00 (20)

PDF
Introduction to java servlet 3.0 api javaone 2009
JavaEE Trainers
 
PDF
Java EE 01-Servlets and Containers
Fernando Gil
 
PPTX
Cis 274 intro
Aren Zomorodian
 
PPTX
Core web application development
Bahaa Farouk
 
PDF
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Arun Gupta
 
PPT
Ppt for Online music store
ADEEBANADEEM
 
PDF
JavaOne India 2011 - Servlets 3.0
Arun Gupta
 
PDF
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Arun Gupta
 
PPTX
Jsp and Servlets
Raghu nath
 
PPT
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
ODP
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
IndicThreads
 
PDF
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Jagadish Prasath
 
PDF
Servlets Java Slides & Presentation
Anas Sa
 
PDF
Servlets
Sharon Cek
 
PDF
Java part 3
ACCESS Health Digital
 
PDF
4_598113hhhhhhhhhhhhhhhhhhhhhhh0134529250346.pdf
kassyemariyam21
 
PPTX
BITM3730Week12.pptx
MattMarino13
 
PDF
19servlets
Adil Jafri
 
DOCX
Html servlet example
rvpprash
 
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Arun Gupta
 
Introduction to java servlet 3.0 api javaone 2009
JavaEE Trainers
 
Java EE 01-Servlets and Containers
Fernando Gil
 
Cis 274 intro
Aren Zomorodian
 
Core web application development
Bahaa Farouk
 
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Arun Gupta
 
Ppt for Online music store
ADEEBANADEEM
 
JavaOne India 2011 - Servlets 3.0
Arun Gupta
 
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Arun Gupta
 
Jsp and Servlets
Raghu nath
 
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
sindhu991994
 
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
IndicThreads
 
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Jagadish Prasath
 
Servlets Java Slides & Presentation
Anas Sa
 
Servlets
Sharon Cek
 
4_598113hhhhhhhhhhhhhhhhhhhhhhh0134529250346.pdf
kassyemariyam21
 
BITM3730Week12.pptx
MattMarino13
 
19servlets
Adil Jafri
 
Html servlet example
rvpprash
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Arun Gupta
 
Ad

More from Rajesh Moorjani (8)

PDF
Coursejspservlets00
Rajesh Moorjani
 
PPT
Krazykoder variables
Rajesh Moorjani
 
PPT
Krazykoder variables
Rajesh Moorjani
 
PPT
Krazykoder features intro_3
Rajesh Moorjani
 
PPT
Krazykoder features intro_2
Rajesh Moorjani
 
PPT
Krazykoder features intro_2
Rajesh Moorjani
 
PPT
Krazykoder features intro
Rajesh Moorjani
 
PPT
Krazykoder features intro
Rajesh Moorjani
 
Coursejspservlets00
Rajesh Moorjani
 
Krazykoder variables
Rajesh Moorjani
 
Krazykoder variables
Rajesh Moorjani
 
Krazykoder features intro_3
Rajesh Moorjani
 
Krazykoder features intro_2
Rajesh Moorjani
 
Krazykoder features intro_2
Rajesh Moorjani
 
Krazykoder features intro
Rajesh Moorjani
 
Krazykoder features intro
Rajesh Moorjani
 
Ad

Recently uploaded (20)

PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 

Jeetrainers.com coursejspservlets00

  • 2. Servlet / JSP course topics • Chapter 0 Introduction to Java Web Development • Chapter 1 Introduction to servlets • Chapter 2 Introduction to JavaServer Pages • Chapter 3 How to use the MVC pattern in a Java Web Application • Chapter 4 How to share information in servlets and JSPs • Chapter 5 Advanced JSP concepts • Chapter 6 How to use JavaBeans with JSP • Chapter 7 How to use the JSP Expression Language (EL) • Chapter 8 How to use the JSP Standard Tag Library (JSTL) • Chapter 9 How to use custom JSP tags • Chapter 10 How to access databases in java web applications • Chapter 11 How to use JavaMail to send email • Chapter 12 How to secure java web applications • Chapter 13 How to download files with Servlets • Chapter 14 How to work with listeners • Chapter 15 How to work with filters
  • 4. Introduction to Java Web Development • Java Enterprise Edition • Java Web Development • Structure of a web project • Introduction to Web Applications • The first project
  • 6. Java Web Development * Note In this course only JSP & servlets will be discussed
  • 7. Structure of a web project • There are two kind of structures – The structure of the web application in a server – The structure of the IDE • A web project have three main elements – The JSPs files – The java classes – The Configuration file web.xml
  • 8. Structure of a web project in the server
  • 9. Structure of a web project in the server Root of the project Java classes (.class) Java Libraries (.jar) Configuration files Anything web-related - Directories - JavaServer Pages (JSP) - HTML - Css files - JavaScript Files - Etc.
  • 10. Introduction to Web Applications • In a Web Application, web components provide the dynamic extension capabilities for a web server. • Web components can be Java servlets, JSP pages, or web service endpoints. • The interaction between a web client and a web application is explained and illustrated in the next slide figure. – The client sends an HTTP request to the web server. – A web server that implements Java Servlet and JavaServer Pages technology converts the request into an HTTPServletRequest object. – This object is delivered to a web component, which can interact with JavaBeans components or a database to generate dynamic content. – The web component can then generate an HTTPServletResponse or it can pass the request to another web component. – Eventually a web component generates a HTTPServletResponse object. The web server converts this object to an HTTP response and returns it to the client.
  • 11. Introduction to Web Applications
  • 12. Introduction to Web Applications • Servlets are Java programming language classes that dynamically process requests and construct responses.  • JSP pages are text-based documents that execute as servlets but allow a more natural approach to creating static content. • Although servlets and JSP pages can be used interchangeably, each has its own strengths. • Servlets are best suited for service-oriented applications (web service endpoints are implemented as servlets) and the control functions of a presentation-oriented application, such as dispatching requests and handling nontextual data. • JSP pages are more appropriate for generating text-based markup such as HTML, Scalable Vector Graphics (SVG), Wireless Markup Language (WML), and XML.
  • 14. Life Cycle of a JEE Web Application
  • 15. Life Cycle of a JEE Web Application
  • 16. Criteria to develop web applications
  • 17. Exercise 1 • Develope the first java web application 1. Download the file: jspservlet-00.zip 1. Unzip it 2. Import from Eclipse 3. Run it
  • 18. Exercise 1 Results • You should get this result
  • 19. Exercise 1 Analisis • The web.xml file <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" . . . version="2.5"> <servlet> <display-name>HelloWorldServlet</display-name> <servlet-name>HelloWorldServlet</servlet-name> <servlet-class> com.example.servlets.HelloWorldServlet </servlet-class> </servlet> Servlet <servlet> declarations <display-name>AnotherServlet</display-name> <servlet-name>AnotherServlet</servlet-name> <servlet-class> com.example.servlets.AnotherServlet </servlet-class> </servlet>
  • 20. Exercise 1 Analisis • The web.xml file . . . <servlet-mapping> <servlet-name>HelloWorldServlet</servlet-name> <url-pattern>/HelloWorldServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>AnotherServlet</servlet-name> Servlet <url-pattern>/AnotherServlet</url-pattern> mappings </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> </welcome-file-list> </web-app>
  • 21. Exercise 1 Analisis Servlet classes (other might be here classes too) Other resources might be here