Chapter 6- Servlets.pptx - Advanced Programming Chapter 6 Servlets and JSP 1 Objectives At the end of this chapter you will be able to learn HTML HTTP

Chapter 6- Servlets.pptx - Advanced Programming Chapter 6...

This preview shows page 1 - 11 out of 40 pages.

1 Chapter 6 Servlets and JSP Advanced Programming
Image of page 1
2 Objectives At the end of this chapter, you will be able to learn: HTML HTTP Webserver Servlets and its Architecture Servlet API Servlet Life Cycle Session Tracking JSP Overview
Image of page 2
3 HTML Hyper-Text Markup Language Defines tags and formatting's Basic Html document <html> <head> <title> Html Doc </title> </head> <body> <h1> Html is awesome </h1> </body> </html> Html document can be formatted using CSS- cascading style sheet
Image of page 3
4 Web Server A web server is a program running on the server that listens for incoming requests and services those requests as they come in. Once the web server receives a request, depending on the type of request the web server might look for a web page, or it might execute a program on the server. It will always return some kind of results to the web browser, even if its simply an error message saying that it couldn’t process the request. By default the role of a web server is to serve static pages using the http protocol Web servers can be made dynamic by adding additional processing capability to the server 4
Image of page 4
5 HTTP HyperText Transfer Protocol Stateless request/response client-server protocol Requests: Method: GET, POST, HEAD, TRACE, OPTIONS, PUT, DELETE URI (required in HTTP/1.1) Header Fields E.g. how the response should be returned, under what conditions, identification and characterization of client, accounting data Body POST data Empty for GET Response: Status code (machine), reason (human) Header Metadata, e.g. Content-Type (Media type), Content- Length, Last-Modified, Etag
Image of page 5
6 Request-response model request response HTTP HTML HTTP Request <html> <head> <body> <html> <head> <body> Client Server
Image of page 6
7 of 99 7 Three types of tracking methods are used: Cookies: Line of text with ID on the users cookie file URL Session Tracking: An id is appended to all the links in the website web pages. Hidden Form Elements: An ID is hidden in form elements which are not visible to user Dynamic generated html allows the state to be tracked HTTP - Tracking State
Image of page 7
8 Server Side programming Web Server Application Server Extensions Web Server machine I can serve only static HTML pages Not a problem. I can handle dynamic requests.
Image of page 8
9 9 Several different tools are available for extending the server capabilities Java enterprise architecture( servlet & jsp) ASP.Net architecture PHP CGI-Perl scripting These tools process incoming requests from the user and generate custom html pages Server Extensions
Image of page 9
10 Servlets A servlet is a compiled Java class that run server- side under the control of the Web server Servlets are managed by the servlet container , or servlet engine Servlets receive requests and return responses, both of which are supported by the HTTP protocol When the Web Server receives a request that is for a servlet, the request is passed to the servlet container
Image of page 10
Image of page 11

You've reached the end of your free preview.

Want to read all 40 pages?

  • Fall '19
  • World Wide Web, Web server, Web browser, container, HTTP cookie, Hypertext Transfer Protocol

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture