[ http://issues.apache.org/jira/browse/MYFACES-453?page=comments#action_12330629 ]
Rob Raymond commented on MYFACES-453: ------------------------------------- I ran into a similar issue with t:tabbedPane but the offending cast to HttpServletRequest was in addAdditionalHeaderInfoToRender() of AddResource.java . Since this method is manipulating the header and that is not possible in a portal, the right thing might be to check if isPortalRequest and do nothing. > Tomahawk's use of HttpServletRequest breaks JSF Portlets > -------------------------------------------------------- > > Key: MYFACES-453 > URL: http://issues.apache.org/jira/browse/MYFACES-453 > Project: MyFaces > Type: Bug > Components: Tomahawk > Versions: 1.0.9m9 > Reporter: Stan Silvert > Assignee: Stan Silvert > Attachments: AddResource.239380.patch > > I have a report of a user who wanted to use JSCookMenu in a portlet. This > results in a ClassCastException because > org.apache.myfaces.component.html.util.AddResource assumes that the > underlying request object will be an HttpServletRequest. > I will fix this for AddResource, but I suspect that there are other offending > classes in Tomahawk. > For future reference, you should always use methods from ExternalContext > instead of doing (HttpServletRequest)ExternalContext.getRequest(). > If you MUST use features of HttpServletRequest that ExternalContext doesn't > offer then you should use the PortletUtil to make sure that you don't break > portlets. To tell if you are running in a portlet environment, you can say: > org.apache.myfaces.portlet.PortletUtil.isPortletRequest(FacesContext > facesContext) > Note: calling PortletUtil does not put any dependency on the Portlet API. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira