Menu

JOSSO with Tomcat 7 utf-8 encode

2017-02-07
2017-02-07
  • Filipe Queirós

    Filipe Queirós - 2017-02-07

    Case 1: I have a virtual machine with Ubuntu and Tomcat 7.x. If i POST data with special characters to the server i'ts ok. I have a filter that run before any servlet and set the encode to UTF-8 request.setCharacterEncoding("utf-8");

    Case 2: In the same virtual machine i have other Tomcat 7.x installation (reply). Now i installed the JOSSO 1.8.6 on Tomcat 7.x. After this when i try to submit POST data with special characters the servlet don't decode correctly request.getParameter("reportText");.

    I believe that the JOSSO have any filter that run before my Encode Filter and uses the request what makes my filter request.setCharacterEncoding("utf-8") useless.

    What i try to resolve the problem:

    • I have set the URIEncoding="utf-8" at the Tomcat Connector tag (server.xml).
    • I have used setCharacterEncoding().
    • I have set the JAVA_OPTS="$JAVA_OPTS -Djavax.servlet.request.encoding=UTF-8 -Dfile.encoding=UTF-8" on tomcat setenv.sh
    • I checked the HTTP Headers and they are correct (Content-Type=text/plain;charset=utf-8)
    • I have enable Tomcat filter setCharacterEncodingFilter

    The POST request is generated by client JSP:

    <form id="xx" name="xx" onsubmit="return validateAndSubmitForm(this);" action="submitReport.do" method="post" enctype="application/x-www-form-urlencoded; charset: utf-8;"> xxx </form>
    

    Any ideas? It's possible JOSSO causes this behavior?
    Thank you.

     

    Last edit: Filipe Queirós 2017-02-08
  • Gianluca Brigandi

    Hi Felipe,
    JOSSO shouldn't be messing with your encoding. I'd suggest you try with the latest JOSSO Agent release. I'd also try to uninstall the agent from the second tomcat instance in order to determine whether the agent is the piece triggering the issue.
    Regards,
    Gianluca.

     

Log in to post a comment.