[richfaces-issues] [JBoss JIRA] (RF-12352) rich:fileUpload does not work properly with Mojarra 2.1.7 when FacesContext.isPostback() is executed before FacesContext.getPartialViewContext()

Brian Leathem (JIRA) jira-events at lists.jboss.org
Tue Aug 7 14:17:06 EDT 2012


     [ https://issues.jboss.org/browse/RF-12352?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Leathem updated RF-12352:
-------------------------------

    Fix Version/s: 4-Tracking

    
> rich:fileUpload does not work properly with Mojarra 2.1.7 when FacesContext.isPostback() is executed before FacesContext.getPartialViewContext()
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: RF-12352
>                 URL: https://issues.jboss.org/browse/RF-12352
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-input
>    Affects Versions: 4.0.0.Final
>         Environment: Mojarra 2.1.7, Jetty or JBoss 5.1
>            Reporter: Tomasz Kurpios
>             Fix For: 4-Tracking
>
>
> In Mojarra 2.1.7 the value of first invocation of FacesContextImpl.isPostback() is cached as a request attribute. It checks for the existence of javax.faces.ViewState parameter. If we are processing MultipartRequest and FacesContextImpl.isPostback() is executed before FacesContextImpl.getPartialViewContext(), FileUploadPartialViewContextFactory hasn't had yet chance to parse this MultipartRequest's parameters, so FacesContextImpl.isPostback() returns (and caches) false. Therefore no processing (decodes, validations, updates) happens and as a consequence properly registered FileUploadListener is not executed.
> The only reason why it normally works is because completely unrelated method, com.sun.faces.context.ExceptionHandlerFactoryImpl.getExceptionHandler(), *happens to* call FacesContext.getPartialViewContext() and this happens during creation of FacesContext instance.
> In my environment, I used my custom ExceptionHandlerFactory (registered in faces-config.xml) which did not call FacesContext.getPartialViewContext() and the problem appeared, because FacesContext.isPostback() was called first.
> This means that currently FileUploadPartialViewContextFactory is very tightly coupled to FacesContextImpl, which in my opinion should be fixed.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list