This is more a jsp/servlets/tomcat problem. There is a variable that
controls character encoding in Struts2, it defaults to UTF-8 but I am
not sure of when it is used by struts, I think it's for .properties reading.
In struts.properties:
struts.i18n.encoding=UTF-8
First you need to tell the tomcat container to read every request in
UTF-8, you do by adding the property URIEncoding="UTF-8" to the
connector in your conf/server.xml from your tomcat installation.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" URIEncoding="UTF-8" />
Then in every jsp/servlet response set the character encoding to UTF-8
In a servlet:
response.setContentType("text/html; charset=UTF-8");
In a jsp:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
Then set the page header meta content-type to UTF-8 or IExplorer will
send ascii even if the page is already in utf-8
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
The files (.java .jsp .???) MUST be saved as UTF-8 or the characters
won't display correctly.
Perssy Llamosas.
Morten wrote:
Hi Perssy
What do you mean by Page Header?
Just curious. Working with some of the same things.
Best regards,
Morten
"Perssy Llamosas" <[EMAIL PROTECTED]> skrev i en meddelelse
news:[EMAIL PROTECTED]
Solved it on my own.
The page header requires to be in utf-8 too, it is not enough to have the
page encoding in jsp to utf-8.
Without that line IE returns ascii while firefox returns utf-8.
Perssy Llamosas wrote:
Hello,
I am trying to make struts read my requests as UTF-8, so far I have
configured Tomcat connector to uriencode in utf-8 but my struts beans
still receive "?" strings. What am I missing?
Perssy Llamosas
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]