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

PPT
Project First presentation about introduction to technologies to be used
PPTX
Advance java session 9
PDF
Ch. 13 filters and wrappers
PPTX
Jsp (java server page)
PPTX
Java Web services
PPT
Deploying java beans in jsp
PDF
Java Server Pages
PDF
JavaEE and RESTful development - WSO2 Colombo Meetup
Project First presentation about introduction to technologies to be used
Advance java session 9
Ch. 13 filters and wrappers
Jsp (java server page)
Java Web services
Deploying java beans in jsp
Java Server Pages
JavaEE and RESTful development - WSO2 Colombo Meetup

What's hot (19)

PDF
Java colombo-deep-dive-into-jax-rs
PPTX
Alfresco Mvc - a seamless integration with Spring Mvc
PPTX
Client server 01
PPTX
Jsp basic
PPTX
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
PPTX
Java Server Pages
PPTX
Java Server Pages(jsp)
PPT
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
PDF
Jive the renovation of Aswing
PPT
Maven introduction in Mule
PPTX
PPT
weblogic training | oracle weblogic online training | weblogic server course
PPT
Introduction to the Servlet / JSP course
PPT
Jsp Comparison
PPTX
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
PPT
Jsp(java server pages)
PDF
Web a Quebec - JS Debugging
PDF
J2EE_Course_Content
PDF
SpringPeople Introduction to MongoDB Administration
Java colombo-deep-dive-into-jax-rs
Alfresco Mvc - a seamless integration with Spring Mvc
Client server 01
Jsp basic
INTRODUCTION TO JSP,JSP LIFE CYCLE, ANATOMY OF JSP PAGE AND JSP PROCESSING
Java Server Pages
Java Server Pages(jsp)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Jive the renovation of Aswing
Maven introduction in Mule
weblogic training | oracle weblogic online training | weblogic server course
Introduction to the Servlet / JSP course
Jsp Comparison
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
Jsp(java server pages)
Web a Quebec - JS Debugging
J2EE_Course_Content
SpringPeople Introduction to MongoDB Administration
Ad

Viewers also liked (8)

PPT
Siep european funding saxion and eu projects
PPT
Grenzeloos Ondernemen Boost 11 Feb 2010 V3
PDF
3.8 % tax on Real Estate
PPT
Dutch UAS towards diversified income
PPT
Siep european funding saxion niche
PPT
Projecten Functies 21 01 2010
PPT
Krazykoder variables
PPT
Projectmanagement Refresher for Trainees
Siep european funding saxion and eu projects
Grenzeloos Ondernemen Boost 11 Feb 2010 V3
3.8 % tax on Real Estate
Dutch UAS towards diversified income
Siep european funding saxion niche
Projecten Functies 21 01 2010
Krazykoder variables
Projectmanagement Refresher for Trainees
Ad

Similar to Coursejspservlets00 (20)

PDF
Introduction to java servlet 3.0 api javaone 2009
PDF
Java EE 01-Servlets and Containers
PPTX
Cis 274 intro
PPTX
Core web application development
PDF
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
PPT
Ppt for Online music store
PDF
JavaOne India 2011 - Servlets 3.0
PDF
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
PPTX
Jsp and Servlets
PPT
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
PDF
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
ODP
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
PDF
Servlets Java Slides & Presentation
PDF
Servlets
PDF
PDF
4_598113hhhhhhhhhhhhhhhhhhhhhhh0134529250346.pdf
PPTX
BITM3730Week12.pptx
PDF
19servlets
DOCX
Html servlet example
PDF
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Introduction to java servlet 3.0 api javaone 2009
Java EE 01-Servlets and Containers
Cis 274 intro
Core web application development
Servlets 3.0 - Asynchronous, Extensibility, Ease-of-use @ JavaOne Brazil 2010
Ppt for Online music store
JavaOne India 2011 - Servlets 3.0
Servlets 3.0 - Asynchronous, Easy, Extensible @ Silicon Valley Code Camp 2010
Jsp and Servlets
192563547-Servletsjhb,mnjhjhjm,nm,-Pres-ppt.ppt
Java EE 6 - Deep Dive - Indic Threads, Pune - 2010
Java EE 6 = Less Code + More Power (Tutorial) [5th IndicThreads Conference O...
Servlets Java Slides & Presentation
Servlets
4_598113hhhhhhhhhhhhhhhhhhhhhhh0134529250346.pdf
BITM3730Week12.pptx
19servlets
Html servlet example
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...

More from Rajesh Moorjani (7)

PDF
Jeetrainers.com coursejspservlets00
PPT
Krazykoder variables
PPT
Krazykoder features intro_3
PPT
Krazykoder features intro_2
PPT
Krazykoder features intro_2
PPT
Krazykoder features intro
PPT
Krazykoder features intro
Jeetrainers.com coursejspservlets00
Krazykoder variables
Krazykoder features intro_3
Krazykoder features intro_2
Krazykoder features intro_2
Krazykoder features intro
Krazykoder features intro

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
Tartificialntelligence_presentation.pptx
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PPTX
A Presentation on Artificial Intelligence
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Mushroom cultivation and it's methods.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Getting Started with Data Integration: FME Form 101
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25-Week II
Chapter 5: Probability Theory and Statistics
SOPHOS-XG Firewall Administrator PPT.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
A novel scalable deep ensemble learning framework for big data classification...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative study of natural language inference in Swahili using monolingua...
Tartificialntelligence_presentation.pptx
Heart disease approach using modified random forest and particle swarm optimi...
A Presentation on Artificial Intelligence
Enhancing emotion recognition model for a student engagement use case through...
Assigned Numbers - 2025 - Bluetooth® Document
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
1 - Historical Antecedents, Social Consideration.pdf
Mushroom cultivation and it's methods.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Building Integrated photovoltaic BIPV_UPV.pdf
Getting Started with Data Integration: FME Form 101

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