[
https://issues.apache.org/jira/browse/TOMAHAWK-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632267#action_12632267
]
Leonardo Uribe commented on TOMAHAWK-1331:
------------------------------------------
Thanks a lot for the log, it helps a lot to understand it.
After looking in deep the code, it seem that TomahawkFacesContextFactory method:
public FacesContext getFacesContext(Object context, Object request, Object
response, Lifecycle lifecycle) throws FacesException
The context variable is in some configuration an instance of
javax.portlet.PortletConfig and in others (I checked jsf 1.1
MyfacesGenericPortlet and the stack trace provided show this)
javax.portlet.PortletContext.
The more user friendly is assume to receive any of the two classes in that var
(checking if this var is instance of javax.portlet.PortletConfig or
javax.portlet.PortletContext). In any case ExternalContext.getContext() only
retrieves a javax.portlet.PortletContext instance, but in this case we don't
have a instance of this class yet, so anyway we need an alternative to detect
if a request is in portlets or not.
I have attached a patch. It could be good to have feedback about it. If not,
I'll commit the solution and close the issue soon
> ExternalContextUtils.getRequestType() doesn't work in a portlet environment
> ---------------------------------------------------------------------------
>
> Key: TOMAHAWK-1331
> URL: https://issues.apache.org/jira/browse/TOMAHAWK-1331
> Project: MyFaces Tomahawk
> Issue Type: Bug
> Components: Portlet_Support
> Affects Versions: 1.1.7
> Environment: WebSphere Portal 6.0
> MyFaces 1.1.6
> Tomahawk 1.1.7
> Portals Bridges 1.0.4
> Reporter: Romain Seguy
> Attachments: TOMAHAWK-1331.log, TOMAHAWK-1331.patch
>
>
> ExternalContextUtils.getRequestType(Object config, Object request) signature
> doesn't correspond to what's used in
> TomahawkFacesContextFactory.getFacesContext(): The called method requires a
> config and a request while it's invoked using a context and a request.
> ==> This always leads to a ClassCastException at
> TomahawkFacesContextFactory.getFacesContext()#64.
> The invoked method seems to have to be fixed something like this:
> class ExternalContextUtils:
> public static final RequestType getRequestType(Object context, Object
> request) {
> if(_PORTLET_CONTEXT_CLASS != null)
> {
> if (_PORTLET_CONTEXT_CLASS.isInstance(context))
> {
> // blablabla
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.