File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts 2 and UTF-8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 and UTF-8" Watch "Struts 2 and UTF-8" New topic

Struts 2 and UTF-8

antonio alcantara

Joined: May 06, 2010
Posts: 8
Hi everyone

I have the next code in a jsp using Struts 2

<a href="<s:url action="management"><s:param name="action">showAuthor</s:param><s:param name="showingAuthor"><s:property value="autor"/></s:param></s:url>" class="autorlistado"><s:property value="autor"/></a>

Let's say for example that the property autor is "José". It is shown alright in the browser, but when I click it and get the showingAuthor in the action file, I get something like "Josquoete". It seems that the param name is not getting the UTF-8 encoding and I'm not able to fix it.

I have this in the Jsp: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %>

And in the struts.xml:

- ?xml version="1.0" encoding="ISO-8859-1" ?>
- constant name="struts.i18n.encoding" value="UTF-8"/>

Does anybody knows how to get the correct UTF-8 string in the action file???

Thanks very much in advance for your time and attention
I agree. Here's the link:
subject: Struts 2 and UTF-8
jQuery in Action, 3rd edition