|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||
See:
Description
| Class Summary | |
| CharsetFilter | sets the ServletRequest.setCharacterEncoding to UTF-8. |
| CharsetTag | |
| ContentTypeTag | sets the content type of the response to the configured value |
Forces the request encoding to UTF-8 or another configurable character encoding.
Problem: in servlet 2.3, when ServletResponse#setLocale(java.util.Locale)
is called, the character encoding is changed implicit in an unspecified way.
To prevent this, this wrapper does not forward the setLocale call.
All JSTL fmt:xxx actions call setLocale on the response, which causes
the problem.
encoding,
via the property tbeller.charset. If the filter is installed,
it defaults to UTF-8, otherwise it defaults to ISO-8859-1.
The filter automatically changes (or adds) the response encoding
of one configurable content-type. If the filter init-param
contentType is set to text/html,
then a response content type will of "text/html; charset=iso-8859-1"
will be changed into "text/html; charset=utf-8".
The ContentTypeTag sets the content-type and character encoding of the response
to the given type.
Filter example:
<filter>
<filter-name>CharsetFilter</filter-name>
<filter-class>com.tonbeller.wcf.charset.CharsetFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>ISO-8859-2</param-value>
<description>character encoding that this filter will enforce</description>
</init-param>
<init-param>
<param-name>contentType</param-name>
<param-value>text/html</param-value>
<description>this content type will be set to the above encoding automatically, e.g. "text/html; charset=iso-8859-1" will become "text/html; charset=utf-8"</description>
</init-param>
</filter>
see JSTL spec, section 8.4 and fmt:requestEncoding
ServletResponse#setLocale(java.util.Locale),
com.tonbeller.tbutils.res
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||