This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
Similar Threads
Problem With I18n feature of Struts2
Url does not have the querystring on using the <s: tags in struts2
s:param struts 2 tag
How to access a property attribute of a value outside of an iterate, but within another iterate
passing form parameters such us textfield values using url tag