• 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

question about chinese in struts

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i
found it's the Strut tag that's _NOT_ handling the utf-8 encoding correctly.
I outputted the following on my result jsp after the chinese is inputted:
Here, the 'name' is inputted in Chinese and encoded as utf-8:
....
<H1> With the Bean Write tag </H1>
NAME=====><bean:write name="loginForm" property="name"/> <BR>
password ==><bean:write name="loginForm" property="password"/>
<HR>
<H1> With the standard Http request object </H1>
Name==><%= request.getParameter("name")%><BR>
password==><%= request.getParameter("password")%><BR>
With the bean:write tag the name is printed out as ???, while the standard
request object display the chinese characters correctly.
Can someone clarify why this is the case? I thought this would not matter
since reflection is doing the same call using
request.getParameter("property") to map the input to the form's property.
 
Ranch Hand
Posts: 416
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello
it depend on your web server.
 
Jason Wu
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you explain in detail?thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic