Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting UTF8 in tomcat or struts?

Status
Not open for further replies.

siberian

Programmer
Sep 27, 2003
1,295
US
Is there a config element in tomcat that will force it to output utf8? I know I can set it on the servlet response but I'm using struts so there is no consistent servlet response object to pull it from.

Tx
 
The only way I know to do it is to put these lines at the start of each JSP ...

<meta http-equiv="Content-Type" content= "text/html;charset=UTF-8 " >
<%@ page contentType= "text/html;charset=UTF-8" pageEncoding= "UTF-8 " %>



 
In struct-config file, you can set "content-type" attribute to the controller element.

<controller
processorClass="org.apache.struts.action.RequestProcessor"
debug="0"
contentType="text/html;charset=UTF-8"/>;

I guess that will work. I haven't tried this though.
 
Thanks again sedj, I tried both of these and the jsp version worked.

Awesome, now to figure out how to get my word file kanji translations into eclipse and my app properties.

Expect more stupid questions soon :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top