5 Replies Latest reply on Sep 21, 2005 5:08 AM by Viet

    UTF-8 form support not working Jboss portal?

    Kev Roast Newbie

      To get the display of UTF-8 characters to work correctly, I added the following to all of our portlet JSP pages:

      <%@ page contentType="text/html;charset=UTF-8" %>

      We found that JBoss Portal will display UTF-8 characters fine - BUT we have not found a why to submit them correctly in a FORM yet... I am looking for a solution for that now. I have tried adding acceptCharset="UTF-8" to all HTML FORM tags but that hasn't worked. And I have also tried changing the line in the theme index.jsp:
      <meta http-equiv="Content-Type" content="text/html" />
      to
      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />

      But that didn't work either :(

      However I say a forum post reply by Julian:
      http://www.jboss.org/index.html?module=bb&op=viewtopic&t=64828

      I have tried making these changes as suggested by Julian:

      org.jboss.portal.core.invocation.ContentTypeInterceptor
      line 113

       // Set content type
       response.setContentType(mimeType);
       response.setCharacterEncoding("UTF-8");
      



      So the pages are showing UTF-8 encoding in both IE and FireFox. This is fine and UTF-8 multi-byte characters are displaying ok.

      This image shows that working:
      http://www.kevs3d.co.uk/dev/jboss_utf8.png

      So now I attempt to enter UTF-8 characters in my FORM, the HTML FORM has the following attribute: acceptCharset="UTF-8" this image shows the input form:

      http://www.kevs3d.co.uk/dev/jboss_forminput.png

      As you can see it's working fine allowing you to input the characters.

      Now we submit the form. At this point if I check the value of the fields submitted to my bean in the debugger the values are a mess of characters and incorrect :( As can be seen on the next screen shot where we output the submitted characters back to the browser:

      http://www.kevs3d.co.uk/dev/jboss_formoutput.png

      Exactly the same web-application, running out of the Jboss Portal (still inside JBoss - but running as a TomCat web-app) works fine and the characters are submitted correctly back to the web-server.

      Does anyone have any idea what I need to do in JBoss Portal to fix this?

      Thanks,

      Kevin
      --
      http://www.alfresco.org