Spring mvc3.1 @ ResponseBody annotation generates a large number of Accept-Charset
Spring 3 MVC uses @ ResponseBody and generates a large response header (the Accept-Charset will reach 4 K +), because StringHttpMessageConverter by default.
The use of HTTP header accept-charset?
Accept-charset accept-encoding accept-language in HTTP headers do they work much? Feel the Content-type function is very big.
A program that encounters a person with an easy-to-write page that returns HTML code.
Google's Sitemap service requires that all site maps published must be encoded in Unicode UTF-8. Google does not even allow other Unicode encodings (such as UTF-16), not to mention non-Unicode encodings such as ISO-8859-1. Technically, this means
Spring3 MVC uses @responsebody to produce very large response headers (accept-charset will reach 4k+). The reason is that stringhttpmessageconverter.writeinternal () writes all available character sets back to the response response header by default:
Web applications must meet the needs of multiple languages. Users in different countries should be able to enter characters in their own languages, and Web applications should be able to display pages in multiple languages according to different
Accept-charsetA rarely used form attribute can be used to implement form submission in pages with different codes. Transferred from Old Wang's Baidu space, recorded here.Author: Lao Wang
Problem Background:The two application codes are different.
Introduction to UTF-8 CodingUTF-8 coding is a widely used code, which is committed to incorporating global languages into a unified code and has already incorporated several Asian languages. UTF stands for the ucstransformation format.
The UTF-8
Encoding problem: why is the response gbk displayed when it is UTF-8? Http://parttime.wengege.com/h/login.html
The response encoding is gbk and UTF-8.
HTTP/1.1 200 OK
Server: nginx/1.4.1
Date: Mon, 09 Jun 2014 15:28:28 GMT
Content-Type:
Spring mvc3.1 @ ResponseBody annotation generates a large number of Accept-Charset, responsebody
Spring 3 MVC uses @ ResponseBody and generates a large response header (the Accept-Charset will reach 4 K +), because StringHttpMessageConverter by
HTTP Header
Accept-charset represents the character set supported by the browser
Example: Accept-charset: ISO-8859-1, UTF-8; q = 0.7, *; q = 0.3
This browser prefers the following character sets
1) favorite ISO-8859-1
2) then UTF-8
3) The
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.