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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.