Servlet and Request Header

Source: Internet
Author: User

1.ServletCall

1.PassURLDirect call

2.<Servlet> </servlet>Call

3.<Form> </form>Tag call

4.InJSPFile call

<JSP: Include page = "/servlet/myservlet" Flush = "true ""

2.HTTPRequest Header

Accept:Acceptable BrowserMimeType

Accept-charset:Acceptable Character Set of the browser

Accept-encoding:The data encoding method that the browser can decode, suchGzip.

Accept-language:Types of languages that the browser wants

Authorization:Authorization information

Connection:Indicates whether a persistent connection is required.

Content-Length:Length of the Request Message Body

COOKIE:Request Header Information

From:Request sender'sEmailAddress.

Host:InitialURLHost and port in

If-modified-since:It is returned only when the requested content is modified after the specified date. Otherwise, it is returned.Not modifiedResponse

Pragma:Specify"No-Cache"Value Indicates that the server must return a refreshed document, even if it has a proxy server and a local copy of the leaf surface

Referer:ContainsURL,User FromURLRepresentative page to ask the current request page

User-Agent:Browser type

UA-pixels, UA-color, UA-OSAndUA-CPU:Non-standard request header, indicating screen size, color depth, operating system andCPUType.

3.HTTPResponse Header

Setcontenttype:SetContent-TypeHeader. MajorityServletThis method is required.

Setcontentlength:SetContent-LengthHeader. For persistentHTTPFor connected browsers, this function is very useful.

Addcookie:SetCookie

Allow:Request methods supported by the server

Content-encoding:Document encoding method

Content-Length:

Content-TypeIndicates what the following document belongsMimeType.

Date:CurrentGMTTime

Expired:When should the document be expired and no longer cached.

Last-modified:The last modification time of the document.

Location:Indicates where the customer should extract documents.LocationUsually not directly set InsteadHttpservletresponseInSerredirect ()Method, and set the status code302

Refresh:Indicates the time after which the browser should refresh the page.

Server:Server name.

Set-COOKIE:SetCookie

WWW-AuthenticateThe customer shouldAuthenticateWhat type of authorization information should be provided in the cast?.

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.