[ 
https://issues.apache.org/jira/browse/ORCHESTRA-17?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Simon Kitching reopened ORCHESTRA-17:
-------------------------------------

      Assignee:     (was: Martin Marinschek)

Wrapping the ExternalContext causes problems as methods added in JSF1.2 are not 
correctly delegated.

In particular, this breaks orchestra+trinidad, as reported by Bruno Aranda:

java.lang.UnsupportedOperationException at
>> javax.faces.context.ExternalContext.setRequest(ExternalContext.java:124)
>> at
>> org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl._isSetRequestBugPresent(GlobalConfiguratorImpl.java:490)
>> at
>> org.apache.myfaces.trinidadinternal.config.GlobalConfiguratorImpl.getExternalContext(GlobalConfiguratorImpl.java:309)
>> at
>> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit.(FacesContextFactoryImpl.java:86)
>> at
>> org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl.getFacesContext(FacesContextFactoryImpl.java:64)
>> at
>> javax.faces.webapp.FacesServlet.prepareFacesContext(FacesServlet.java:234)

In particular, invoking setRequest on the wrapper will end up calling the 
ExternalContext base class method, not the implementation on the wrapped object.

> RequestParameterFacesContextFactory only works with HttpServletResponse
> -----------------------------------------------------------------------
>
>                 Key: ORCHESTRA-17
>                 URL: https://issues.apache.org/jira/browse/ORCHESTRA-17
>             Project: MyFaces Orchestra
>          Issue Type: Bug
>          Components: RequestParameterProvider
>    Affects Versions: 1.0, 1.1
>         Environment: Liferay Portlet Container
>            Reporter: Martin Marinschek
>
> The following snippet wrongly casts to HttpServletResponse, therefore 
> portlet-environments will not work:     
>    if (response instanceof HttpServletResponse)
>         {
>             HttpServletRequest httpServletRequest = (HttpServletRequest) 
> request;
>             
>             // Wrap this request only if something else (eg a 
> RequestParameterServletFilter) has not already wrapped it.
>             if 
> (!Boolean.TRUE.equals(httpServletRequest.getAttribute(RequestParameterServletFilter.REQUEST_PARAM_FILTER_CALLED)))
>             {
>        
> I will commit a solution very soon.
> regards,
> Martin

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to