Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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 2: Encoding UTF-8 problems

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody, my problem is the following, I type characters like this in my page �,�,� when I submit the page and the method get of all fields are executed the action doesn't recognize this characters.
If I set this characters directly in the action then they are showed correctly in my page.

I'm working with struts2, Tomcat 5.5.26 and JDK 1.5.

Do anyone know what's happening???

Thanks and best regards.


[ November 17, 2008: Message edited by: Maria Rosa Jordan ]
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the page set up to be UTF-8? Or is Tomcat configured to use UTF-8? Is it a GET or a POST form? (See #1)

A simple web search will turn up many answers and solutions; it's not really a Struts-specific issue.

Dave

#1: http://www.w3.org/TR/html401/interact/forms.html#submit-format
 
Maria Rosa Jordan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.

Is the page set up to be UTF-8? Or is Tomcat configured to use UTF-8? Is it a GET or a POST form?

Is a POST form.
I think that my Tomcat is not configured to use UTF-8, please, how can I do it?.

The page have this:

<%@page contentType="text/html; charset=UTF-8" %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


Thanks and best regards.
[ November 18, 2008: Message edited by: Maria Rosa Jordan ]
 
Greenhorn
Posts: 2
Python Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

If you guys are building your projects with Maven and are using a pom.xml-file, try specifying the encoding with the build plugin like this:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic