| Michael Wall 2004-06-22, 6:00 pm |
| Hi
We're having problems trying to display extended/special characters in
struts portlets.
This isn't a problem for standard jsp portlets, only struts.
The problem occurs for text on the jsp (temp) or for text retrieved from db2
and displayed with bean:write tags etc. or with a method in the jsp.
db2 character encoding is set to UTF-8
The portlet is deployed on WebSphere PortalServer 4.2 Extend, with WebSphere
4.05 AppServer.
Running the same struts application as a Web Applicaton in local test server
works as expected (WebSphere v4.0 Test Environment), WebSphere Application
Developer 5.1.
We have following tags in jsps:
meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"
%@ page contentType="text/html; charset=UTF-8" %
we have also specified 'contentType="text/html;charset=UTF-8"' in the
struts-config controller
we have tried adding the following to the Portal server JVM settings:
-Dclient.encoding.override=UTF-8
(replacing -Dclient.encoding.override=8859_1) but this strips out everything
after and including the first special character encountered when submitting
form fields. eg. 'empêcher des utilisateurs d'accéder' is passed to
handler/for persistance as 'emp'.
removing this persists as expected but prevents jsp being rendered...
Issue appears to be with transcoding - but can't find much/any documentation
about it. It is installed...
transcoding and filtering are both enabled (from properties files), have
tried with each on/off etc. but no luck
The exception thrown is:
Nested Exception is sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java(Compiled Code))
at java.io.InputStreamReader.convertInto(InputStreamReader.java:152)
at java.io.InputStreamReader.fill(InputStreamReader.java:201)
at java.io.InputStreamReader.read(InputStreamReader.java:264)
at java.io.Reader.read(Reader.java:116)
at com.ibm.transform.wps.Toolkit.writeReaderToWriter(Toolkit.java:408)
at
com.ibm.transform.wps.portletfilter.TranscodingPortletFilter.doService(Trans
codingPortletFilter.java:205)
at
com.ibm.wps.portlet.filters.PortletControlledTranscodingFilter.doService(Por
tletControlledTranscodingFilter.java:195)
at
com.ibm.wps.portletcontainer.portletfilter.PortletFilterAdapter.doFilter(Por
tletFilterAdapter.java:79)
at
com.ibm.wps.portletcontainer.invoker.PortletFilterChainImpl.doFilter(Portlet
FilterChainImpl.java:109)
at
com.ibm.wps.portletcontainer.invoker.PortletInvokerServiceImpl.include(Portl
etInvokerServiceImpl.java:1730)
at
com.ibm.wps.portletcontainer.invoker.PortletInvokerServiceImpl.callPortletMe
thod(PortletInvokerServiceImpl.java:289)
at
com.ibm.wps.portletcontainer.invoker.PortletInvokerServiceImpl.portletServic
e(PortletInvokerServiceImpl.java:951)
at
org.apache.jetspeed.portletcontainer.invoker.PortletInvoker.portletService(P
ortletInvoker.java:154)
Has anyone encountered similar issue or have fix/additional configuration
settings etc.
Michael
|