JSP built-in object HTTP protocol

Source: Internet
Author: User

Some objects can be used in the script section of a JSP page without declaring it, which is The built-in object of the JSP.

jsp The built-in objects are: REQUEST  Span style= "Font-family:times New Roman" >response session application out

The reponse and request objects are Among the more important two of JSP's built-in objects, which provide control over the server and browser communication methods. Before discussing these two objects directly, the HTTP Protocol ---the Word Wide Web Underlying protocol should be introduced briefly.

How does the Word Wide Web work? After entering the correct URL in the browser, if all goes well, the page will appear. For example, in the Browser input field, enter Http://blog.csdn.net/guanjungao My Blog home page appears in the browser window. What's behind this?

When using a browser to get an HTML page from a Web site , the actual use of the Hypertext Transfer Protocol (HTTP) HTTP protocol specifies that the information The transfer method on the Internet, in particular, specifies how the browser interacts with the server.

When a page is fetched from a Web site, the browser opens a connection to the Web server on the site and makes a request, and the server responds with the request, so the HTTP protocol is called the "Request and Response" protocol.

The browser requests a structure, and theHTTP request includes a request line, a header domain, and a possible body of information. The most common type of request is a simple request to the page, as in the following example:

get/hello.htm http/1.1

Host:www.sina.com.cn

This is an example of an HTTP request to the page hello.htm on the site www.sina.com.cn . The first line is the request line, which specifies the method of the request, the requested resource, and the version of the HTTP protocol used.

   in the example above, the method requested is get method, this method obtains a specific resource. In the example above get method used to get hello.htm Web page. Other request methods include post head delete TRACE and put method and so on.

The second line in this example is the header (header). The Host header specifies the Internet address of the hello.htm file on the Web site .

In this example, the host is www.sina.com.cn

A typical request typically contains many headers, called the HTTP headers of the request . The header provides additional information about the information body and the source of the request, some of which are standard, some of which are related to a particular browser.

   a request may also contain an information body. For example, the information body can contain html The contents of the form. On the html on the form, click submit When this form uses action= " post " or action= " get "feature, the contents of the input form are sent to the server, the form content is post method or The GET method is sent in the requested body of information.

   the server returns http response. The response also has a structure where each response starts with a status line and can contain several headers and possible body of information, called the response http head and response information body. These headers and bodies are sent by the server to the client's browser, and the information body is the result of the page run requested by the client, for jsp page, is the static information of the webpage.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.