• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 1 Chinese Character Entry

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

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?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic