is your portlet code setting the content type at all, and is that content type supported according to your portlet.xml ?
The portlet just dispatch to a jsp
PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(mainPage); prd.include(request, response);
In the servlet compiled from the jsp, the content type is set.
_jspxFactory = JspFactory.getDefaultFactory(); response.setContentType("text/html"); pageContext = _jspxFactory.getPageContext(this, request, response, null, true, 8192, true); _jspx_page_context = pageContext;
Do i need to explicitely set the content type in the portlet ?. guess not
The problem is contentType is not set in the class org.jboss.portal.server.output.FragmentResult
I am using only the standard classes like RenderRequest, RenderResponse and NOT JBossRenderRequest, JBossRenderResponse etc... Is it like i have to use JBoss* classes ?
I could send the code if you want to have a quick look!
Sorry, i missed one part of your ques. The portlet.xml supports the content type
<supports> <mime-type>text/html</mime-type> <portlet-mode>EDIT</portlet-mode> <portlet-mode>HELP</portlet-mode> </supports>
I see the same behaviour. I can get around it by :
PortletRequestDispatcher rd = this.getPortletContext().getRequestDispatcher(uri);
if (rd != null)
Not sure if this is a bug, or a feature.....
It works with renderResponse.setContentType("text/html"); .
So its setting this in the class org.jboss.portal.server.output.FragmentResult. But this makes an additional step from specifications and shouldn't have been this way (my opinion :-))
Thanks for your help, Martin!