tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yigal Lazarev" <>
Subject Tomcat 6.0.14 and UTF-8 POST form problem
Date Thu, 08 Nov 2007 00:14:01 GMT

I'm deploying a JSF WAR onto Tomcat 6.0.14 under Windows 2003 with JVM
version 1.6.0_03-b05, and using MySQL db.
When I submit a form using POST method, and in the server side take the
fields and send them as an email using JavaMail- i lose the UTF-8 encoded
characters sent in the form.

I suspect it's something with the Tomcat configuration because it does not
happen when I deploy to Sun Application Server 8.2
And another thing, UTF-8 characters hardcoded in the sending email method
are sent just fine.

After a week of web search and reading documentation, what I tried so far:

* * Converting from ISO to UTF: *
String subj = "קורות חיים של "+new
String(((String)nameTextField.getValue()).getBytes("ISO-8859-1"), "UTF-8");
message.setSubject(subj, "utf-8");
Also doesn't work with ISO-8859-8 which is for hebrew, what I'm trying to
* Inserting URIEncoding="UTF-8" in the HTTP connector in server.xml. *
* Making a filter that will change the request encoding to utf-8:

The filter class:

public class ReqEncodingFilter implements Filter {
public void destroy() { }

/** Preform the filtering. */
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
chain.doFilter(request, response);

public void init(FilterConfig config) throws ServletException { }

Also tried with the example encoding filter that comes with Tomcat. The
web.xml part:

    <filter-name>Set Character Encoding Filter</filter-name>
    <servlet-name>Faces Servlet</servlet-name>
    <filter-name>Set Character Encoding Filter</filter-name>

Also tried with <servlet-name>Faces Servlet</servlet-name> instead of the
url-pattern tag.

* * Making a locale-encoding-mapping-list in web.xml: *

Any suggestions where to look highly appreciated!
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message