[jboss-user] [JBoss Portal Users] - include UTF-8 JSPs in a portlet

TomHombergs do-not-reply at jboss.com
Fri Aug 28 05:14:59 EDT 2009

Hi all,

I'm including a UTF-8 JSP in my Portlet's dowView() as in the code snippet below. The JSP contains some non-latin characters (german umlauts, in my case). These characters are not displayed correctly in the browser, however.

If I simply user response.getWriter().println() to print the same characters, they are displayed correctly.

Can you configure the dispatcher somehow to set the encoding to UTF8? Any ideas why included JSPs are not displayed UTF8-conform?

  | public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException, UnavailableException {
  |   response.setContentType("text/html");
  |   String contentUrl = getContentUrl(request, response);
  |   PortletContext context = getPortletContext();
  |   PortletRequestDispatcher dispatcher = context.getRequestDispatcher(contentUrl);
  |   try {
  |     dispatcher.include(request, response);
  |   } catch (Exception e) {
  |     response.getWriter().println("Cannot display content!");
  |   }
  | }

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252242#4252242

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252242

More information about the jboss-user mailing list