Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2: Encoding UTF-8 problems

 
Maria Rosa Jordan
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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 ]
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Arne Olaf Godtland
Greenhorn
Posts: 2
Java Python Spring
  • Mark post as helpful
  • send pies
  • 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:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic