[ Team LiB ] Previous Section Next Section

Hour 4. How the Browser Interacts with the Server

What You'll Learn in This Hour:

  • What HTTP is

  • About HTTP request and response headers and their component pieces

  • What the differences between the GET and POST request methods are

  • What Secure HTTP is

Even if you didn't realize it, you have used some form of a response or request object in every example thus far. In the simplest JavaServer Pages you have studied, the operations that use these objects were hidden from you. For example, the implicit out object is acquired behind the scenes using the getWriter method from an instance of HttpServletResponse. In the last hour, you used the implicit request object to discover the values of form variables. Requests and their responses are at the heart of most JSP and servlet operations.

All servlets and JSPs use a request-response programming model. Servlets are capable of working with any kind of request—making them suitable for servicing quite a few Internet protocols based on the request-response model. Servlets are commonly used to work with the Hypertext Transfer Protocol, or HTTP, and so there is a specialized class, HttpServlet, designed to make it easier for you. JSPs almost always work exclusively with HTTP. Because so much of what is done with JSPs and servlets revolves around HTTP, it's worth spending an hour exploring the protocol.

    [ Team LiB ] Previous Section Next Section