Introduction to the Servlet / JSP course

4,569 views

Published on

Introduction to the Servlet / JSP course

Published in: Technology, Education
1 Comment
14 Likes
Statistics
Notes
  • great for someone coming form another server side language, could you post jspservle-00.zip file ?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,569
On SlideShare
0
From Embeds
0
Number of Embeds
209
Actions
Shares
0
Downloads
517
Comments
1
Likes
14
Embeds 0
No embeds

No notes for slide
  • <div align="center"> <table> <tr> <td valign="top">Excellent book for beginners<br/> and practical examples</td> <td valign="top">Excellent book for<br/> theory / certification</td> </tr> <tr> <td align="center"> <iframe src="http://rcm.amazon.com/e/cm?t=marcelblog-20&o=1&p=8&l=as1&asins=1890774448&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> </td> <td align="center"> <iframe src="http://rcm.amazon.com/e/cm?t=marcelblog-20&o=1&p=8&l=as1&asins=1932394389&fc1=000000&IS2=1&lt1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe> </td> </tr> </table> </div>
  • Introduction to the Servlet / JSP course

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

    ×