OK,
This seems to be a problem with the MyFaces implementation of mehtod
'selectContentType' in class
org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils. It appears
that code sets the default content type to null and
then attempts to set it to either text/html or text/xhtml if it finds a
matching string in ContentTypeList. From what I can see
it does not equate text/* to either text/html or text/xhtml, so the content
type remains null and an exception is thrown. This
can be 'fixed' by initializing variable 'selectContentType' like so:
String selectedContentType = HTML_CONTENT_TYPE;
Which is at line 999 for the file $Revision: 422578 $ $Date: 2006-07-17
00:29:45 +0000 (Mon, 17 Jul 2006) $
That now allows the MyFaces portlet to be correctly rendered, but I'm not
sure it is the ideal solution.
Anil
-----------------------------------------------------------------------------------------------------------------------
Hi,
I am having problems getting a JSF (MyFaces) portlet to work through WSRP4J.
When I try to access the remote portlet I get the
exception detailed below in Tomcat's console. I have the same porlet working
fine when run locally and the 'wsrp-testportlet'
also works correctly. It seems that it doesn't like me using any JSF tags in
my .jsp file. If I use plain HTML or JSP tags
and/or scriplets it works fine, but the use of any JSF tags instead (i.e.
<f:view> ..) causes the exception shown. I can't see
where the problem lies since the portlet works without a problem when run
locally.
The exception seems to indicate that the returned content is not of a
supported type, but I am sure it is 'text/html' (as
specified in my 'web.xml' file). I have also noted that changing the content
type to something other than 'text/html' inside
the actual JSF file prevents the exception being thrown but then causes no
content to be rendered inside the portlet.
Any help with this will much appreciated.
Anil
Tomcat log output:
2006-07-31 14:54:38 ApplicationDispatcher[/google-portlet] Servlet.service()
for servlet jsp threw exception
java.lang.IllegalArgumentException: ContentTypeList does not contain a
supported content type: application/soap+xml,
application/dime, multipart/related, text/*
at
org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.selectContentType(HtmlRendererUtils.java:1043)
at
org.apache.myfaces.renderkit.html.HtmlRenderKitImpl.createResponseWriter(HtmlRenderKitImpl.java:126)
at
javax.faces.webapp.UIComponentTag.setupResponseWriter(UIComponentTag.java:936)
at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:310)
at org.apache.myfaces.taglib.core.ViewTag.doStartTag(ViewTag.java:70)
at
..................................................