aspose file tools*
The moose likes Struts and the fly likes Struts 2: Encoding UTF-8 problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2: Encoding UTF-8 problems" Watch "Struts 2: Encoding UTF-8 problems" New topic
Author

Struts 2: Encoding UTF-8 problems

Maria Rosa Jordan
Greenhorn

Joined: Nov 17, 2008
Posts: 3
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Nov 17, 2008
Posts: 3
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

Joined: Mar 22, 2011
Posts: 2

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:

 
Don't get me started about those stupid light bulbs.
 
subject: Struts 2: Encoding UTF-8 problems