Encoding problem using JSP in a portlet

You might experience problems with the encoding when developing JSP based portlets (this applies to both external portlets and the sitevision internal JSP portlet). The problem is that the tomcat JSP compiler jasper assumes that the portlet is ISO-8859-1. If you are using other encoding like UTF-8, make sure that you specify the contentTyping using the JSP page directive.

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

Note that any internal JSP portlet uses UTF-8 and must have this attribute set.

If your JSP portlet includes other resources like HTML jasper might behave strangely (sometimes assuming UTF-8 and sometimes ISO-8859-1) with resulting encoding problems. To solve this issue alter the extention of your HTML file to jsp and add the page directive specified above.

The java files generated by jasper are located in the working directory of sitevision.

.../data/temp/work/...

Denna sida publicerades: 2016-09-30

Skriv ut PDF-avsnitt

Hjälpte informationen på den här sidan dig?

Missa inga nya rön, tips och tricks! Prenumerera på insite!

Find us!

SiteVision AB (Headquarter)
Vasagatan 10
702 10 Orebro
Sweden

Info: +46 19-17 30 30
Support: +46 19-17 30 39

Latest Tweets