Javax. servlet. http. httpservletresponse interface (HTTP Version)

Source: Internet
Author: User

Httpservletresponse adds a method to indicate the status code, status information, and response header. It is also responsible for decoding the http session ID written to a web page in the URL.

Methods In the httpservletresponse Interface
Void addcookie adds a set-Cookie header to the response.
Void adddateheader (string name, long date) uses the specified date value to add a method with the specified name (or replace all the Response Header labels.
Void setheader (string name, string value) sets a response header with the specified name and value.
Void addintheader (string name, int value) uses the specified integer value to add the response header with the specified name (or replace all header labels with this name ).
Boolean containsheader (string name) returns true if the response contains the header mark of this name.
String encoderedirecturl (string URL) if the client does not know to accept cookid, the session ID is added to the URL. The first method only calls the URLs used in sendredirect. Other encoded URLs should be passed to encodeurl ()
String encodeurl (string URL)
Void senderror (INT status) sets the response status code to a specified value (optional status information ). Httpservleetresponse defines a complete set of Integer constants to indicate valid State values.
Void senderror (INT status, string MSG)
Void setstatus (INT status) specifies the response status code. Only applicable to the response that does not generate an error, while the error response uses senderror ().

# Java Column

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.