-
1. Re: Exception with custom portlet: content type is null
mholzner Jun 30, 2005 6:21 PM (in response to vinkh)is your portlet code setting the content type at all, and is that content type supported according to your portlet.xml ?
-
2. Re: Exception with custom portlet: content type is null
vinkh Jul 1, 2005 6:53 AM (in response to vinkh)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! -
3. Re: Exception with custom portlet: content type is null
vinkh Jul 1, 2005 8:04 AM (in response to vinkh)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>
-
4. Re: Exception with custom portlet: content type is null
mholzner Jul 1, 2005 8:08 AM (in response to vinkh)I see the same behaviour. I can get around it by :
renderResponse.setContentType("text/html");
PortletRequestDispatcher rd = this.getPortletContext().getRequestDispatcher(uri);
if (rd != null)
{
rd.include(renderRequest, renderResponse);
}
else
{
writeError(renderResponse, uri);
}
Not sure if this is a bug, or a feature..... -
5. Re: Exception with custom portlet: content type is null
vinkh Jul 1, 2005 9:12 AM (in response to vinkh)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!