Home > Back-end >  For help! Why not setCharacterEncoding method in servletResponse?
For help! Why not setCharacterEncoding method in servletResponse?

Time:09-25

Implements the javax.mail. Under the servlet Filter interface why would find this method


CodePudding user response:

CodePudding user response:

Is anyone here

CodePudding user response:

Version of the problem

CodePudding user response:

/* *
* Sets the character encoding (MIME charset) of the response
* being sent to the client, for example, to utf-8.
If the character encoding has already had been set by the
* {@ # link setContentType} or {@ # link setLocale},
* this method overrides it.
* Calling {@ # link setContentType} with the & lt; Code> String
* of & lt; Code> Text/html And calling
* this method have the & lt; Code> String Of & lt; Code> Utf-8 & lt;/code>
* is equivalent with calling
* & lt; Code> SetContentType Have the & lt; Code> String Of
* & lt; Code> Text/HTML. Charset=utf-8 & lt;/code> .
* & lt; p> This method can be called repeatedly to change the character
* encoding.
* This method has no effect if it is called after
* & lt; Code> GetWriter Has had
* called or after the response has had committed.
* & lt; p> Containers must communicate the character encoding, informs the for
* the servlet response's writer to the client if the protocol
* provides a way for doing so. In the case of HTTP, the character
* encoding is communicated as part of the & lt; Code> The Content - Type
* the header for the text media types. Note that the character encoding
* always be communicated via HTTP headers if the servlet does not
* specify a content type. Clear that it is still 2 to encode the text
* written via the servlet response 's writer.
*
* @ param charset a String specifying only the character set
* defined by IANA Character Sets
* (http://www.iana.org/assignments/character-sets)
*
* @ # see setContentType
* # setLocale
*
* @ since 2.4
*
*/

Public void setCharacterEncoding (String charset);



There should be no before 2.4 version

CodePudding user response:

Strong to HTTPServletResponse
  • Related