1 / 27

Tim Berners-Lee

Tim Berners-Lee. First ever web server. First ever website. August 6 th 1991: info.cern.ch. First ever web server. First ever website. info.cern.ch/hypertext/WWW/TheProject.html. HTTP history. Hypertext Transfer Protocol “//” unnecessary. TimBL says ‘sorry’ HTTP 0.9 released 1991

tallys
Download Presentation

Tim Berners-Lee

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tim Berners-Lee

  2. First ever web server. First ever website August 6th 1991: info.cern.ch

  3. First ever web server. First ever website info.cern.ch/hypertext/WWW/TheProject.html

  4. HTTP history • Hypertext Transfer Protocol • “//” unnecessary. TimBL says ‘sorry’ • HTTP 0.9 released 1991 • HTTP 1.0 released 1996 • HTTP 1.1 released 1997 (persistent tcp conn.) • HTTP 1.1 update 1999

  5. HTTP RFC2616 • Hypertext Transfer Protocol • “//” unnecessary. TimBL says ‘sorry’ • HTTP 0.9 released 1991 • HTTP 1.0 released 1996 • HTTP 1.1 released 1997 • HTTP 1.1 update 1999

  6. Request Response Cycle HTTP response HTTP request TCP Connection

  7. HTTP REQUEST • Request Line <CR><LF> • Headers <CR><LF> • Empty Line <CR><LF> • Message Body <CR><LF> (optional)

  8. HTTP REQUEST • GET /downloads/download.htm http/1.1 • Host: notborder.org

  9. HTTP Request Methods • GET • HEAD • POST • PUT • DELETE

  10. HTTP Request Methods • GET • HEAD • POST • PUT • DELETE C R U D

  11. HTTP Request Methods • GET • HEAD • POST • PUT • DELETE Create Read Update Delete

  12. HTTP RESPONSE • Status Line <CR><LF> • Headers <CR><LF> • Empty Line <CR><LF> • Message Body <CR><LF> (optional)

  13. HTTP RESPONSE HTTP/1.1 200 OK<CR><LF> Date: Mon, 23 May 2005 22:38:36 GMT Server: Apache/2.1.1.6 (Red-Hat/Linux) Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT Content-Length: 4387 Connection: close Content-Type: text/html; charset=UTF-8 <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Trasitional… <html> <head>

  14. HTTP Status Codes • OK • Bad Request • Unauthorized • Forbidden • Not Found • I’m a teapot 500 Internal Server Error

  15. HTTP Status Codes • OK • Bad Request • Unauthorized • Forbidden • Not Found • I’m a teapot 500 Internal Server Error RFC 2324 released April 1st 1998 Hyper Text Coffee Pot Control Protocol http://tools.ietf.org/html/rfc2324 http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_Protocol

  16. EE Application Servers

  17. Java EE6 Reference Implementation Glassfish

  18. Server Machine Web Server App Web Container App HTTP request Servlet

  19. Server Machine Web Server App Web Container App Servlet HTTP response

  20. Server Machine HTTP request Container Servlet request response

  21. Server Machine Container thread Servlet request response

  22. Server Machine HTTP response Container thread Servlet service() response request Dfdsjkl;fdjksl; Fdsflkjsfs Sfjdkljlfslss Fjklsl Fjkdlsjfklsjljsls Jljlksjkljl;fkjl; doGet()

  23. Server Machine Container thread Servlet response request

  24. Example Code import javax.servlet.*; import javax.servlet.http.*; import java.io.*; public class TestServletextends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { PrintWriter out = response.getWriter(); java.util.Date today = new java.util.Date(); out.println(“<html>” + “<body>” + “<h1 style = ‘text-align:center’>” + “Test Servlet</h1>” + “<br>” + today + “</body>” + “</html>”); } }

  25. Servlet Deployment • web.xml“Web Application Deployment Descriptor” <web-app> <context-root>/GreatWebApp</context-root> <servlet> <servlet-name>Freddy</servlet-name> <servlet-class>foo.MyServlet1</servlet-class> </servlet> <servlet-mapping> <servlet-name>Freddy</servlet-name> <url-pattern>/public/downloads</url-pattern> <url-pattern>/public/tracy/*.jsp</url-pattern> <servlet-mapping> </web-app>

  26. Alternative Deployment • Annotations @WebServlet( name = “Freddy”, urlPatterns = {“/public/downloads”, “/public/tracy/*.jsp”}) public class MyServlet1 extends HttpServlet { …

More Related