cancel
Showing results for 
Search instead for 
Did you mean: 

Patching JBoss Portal for UTF-8 character set support

kevinr
Star Contributor
Star Contributor
We have patched JBoss Portal to correctly set the UTF-8 encoding for pages. But - the patch has not been applied to the specific JBoss bundle you download with Alfresco yet.

We have uploaded a patch file for JBoss Portal to here:

http://www.alfresco.org/resource/portal-server-lib.zip

Stop JBoss, unZip the JAR file from the above location and overwrite the file at this location with the patched file:

alfresco\jboss\server\default\deploy\jboss-portal.sar\lib

And restart.

Thanks,

Kevin
1 REPLY 1

mpetre
Champ in-the-making
Champ in-the-making
Hi Kevin,

The patch is not complete I think, if you apply it to the stock jboss-portal.sar there are still some issues. If you apply it to a redeployed jboss portal with the following fixes applied, it works fine and dandy Smiley Happy

Fix 1:
core/src/main/org/jboss/portal/core/invocation/ContentTypeInterceptor.java
line 115, add
response.setCharacterEncoding("UTF-8");

Fix 2:
/server/src/main/org/jboss/portal/server/servlet/AbstractMainServlet.java
line 76, replace doGet with the following:
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
   {
      log.info("Setting character encoding to UTF-8…");
      req.setCharacterEncoding("UTF-8");
      PortalServer container = getContainer();
      ServerManager manager = container.getManager();
      InvocationFactory ctx = manager.getInvocationContext();
      Invocation invocation = ctx.decode(req, resp);
      invoke(invocation);
   }

Compile, deploy, unjar the .sar and apply your patch… now everything UTF8 works fine Smiley Happy

Regards,
Michael