Commits

Anonymous committed de92cc5

Trying to fix content type issue on jboss portal 2.2.0
22:39:43,484 ERROR [Jsr168Dispatcher] Could not execute action
java.lang.IllegalStateException: No content type defined
at org.jboss.portal.server.output.FragmentResult.getOutputStream(FragmentResult.java:190)
at org.jboss.portal.portlet.impl.RenderResponseImpl.getPortletOutputStream(RenderResponseImpl.java:99)
at org.jboss.portal.portlet.impl.DispatchedHttpServletResponse$1.<init>(DispatchedHttpServletResponse.java:92)
at org.jboss.portal.portlet.impl.DispatchedHttpServletResponse.getOutputStream(DispatchedHttpServletResponse.java:90)
at javax.servlet.ServletResponseWrapper.getOutputStream(ServletResponseWrapper.java:101)
at com.opensymphony.webwork.portlet.result.PortletVelocityResult.executeRenderResult(PortletVelocityResult.java:165)
at com.opensymphony.webwork.portlet.result.PortletVelocityResult.doExecute(PortletVelocityResult.java:90)
at com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execute(WebWorkResultSupport.java:143)
Issue number:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2689573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (1)

src/java/com/opensymphony/webwork/portlet/result/PortletVelocityResult.java

                 contentType = contentType + ";charset=" + encoding;
             }
 
+            response.setContentType(contentType);
+
             VelocityManager velocityManager = VelocityManager.getInstance();
             Template t = getTemplate(stack,
                     velocityManager.getVelocityEngine(), invocation,
 
             Context context = createContext(velocityManager, stack, request,
                     response, finalLocation);
+
             Writer writer = new OutputStreamWriter(response.getOutputStream(),
                     encoding);
 
-            response.setContentType(contentType);
-
             t.merge(context, writer);
 
             // always flush the writer (we used to only flush it if this was a