-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Vincent,
Vincent Lin wrote: > I solved this problem finally. That's good, but .... > But it still strange that I've traced the struts 2.0.6 source code > and found that id does change the encoding of HttpServletRequest in > Dispatcher.java(line 650): [snip] > if (encoding != null) { > try { > request.setCharacterEncoding(encoding); > } catch (Exception e) { > LOG.error("Error setting character encoding to '" + encoding > + "' - ignoring.", e); > } > } [snip] > It seems to get encoding parameter from struts.properties with key > struts.i18n.encoding in struts.properties file. > But somehow it doesn't work in my app. So, setting "struts.i18n.encoding=UTF8" in struts.properties doesn't work? Do you know how the "Inject" annotation works? I certainly don't. Are you sure that's not a system property (instead of a property loaded from a file)? > The filter has solved this problem. But I think in struts 2, we > shouldn't [use] this filter? It makes the code a bit ugly. I agree. It seems like S2 includes the capability of fixing the request encoding (and should do the same thing as the CharacterEncodingFilter). Perhaps it's just not configured properly. > The behaviors in IE and Firefox are different really confuses me. > Why the browser affect the character encoding in HttpServletRequest? I would bet that Firefox is better about reporting the encoding of the request, and it's sending "UTF8" as part of the encoding header. MSIE might just be assuming that since the server sent the (previous) response as UTF-8, that the server will expect UTF-8 in the (next) request, so it doesn't bother to mention it. That's just a wild guess. The inconsistency of browsers and servers with regard to character encoding of requests and URLs is shocking. :( - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGg85T9CaO5/Lv0PARAt4pAJ9rzppybyanmGVDsakmbI58auqt5QCeONJN +PLvOL7Gig4SNF1yhhzCl54= =Iq05 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]