This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I'm having problems enhancing an extremely old legacy application that was developed using struts 1.2.9 and tiles. Essentially, the application is to support the Chinese language and some of the pages must allow for Chinese character entry. When I enter Chinese characters into the text box, the page refreshes and the text box contains unrecognized characters. I have set the encoding of the JSP/Servlets to UTF-8 and explicitly set the HttpServletRequest/HttpServletResponse content type to utf-8. All the display text is successfully is successfully showing Chinese characters, so the correct resource bundle is being applied. However, posting forms with Chinese characters completely fails.
What I've tried:
1. Added <%@ page contentType="text/html; charset=UTF-8" %> <%@ page pageEncoding="UTF-8" %> to all JSPs
2. In struts-config.xml, I've defined <controller processorClass="org.desolate.RequestProcessor"/>with methods that set the request/response character encoding to UTF-8.
3. Invoked Charset.defaultCharset() in the debugger and it shows that UTF-8 is the default.
4. updated the server.xml connector definitions to use URIEncoding="UTF-8"
So, the problem seems to be specific to posting text field data. The input is chinese text, but when the page is refreshed, unrecognised characters are shown...
As mentioned, I am using struts 1.2.9 and tiles, which is deployed on springsource vmfrabic TCServer (tomcat 7 config), using Java 7.
can anyone suggest things to try, I must be missing something very fundamental?