Tomasz Kurpios created RF-12352:
-----------------------------------
Summary: 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
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
_______________________________________________
richfaces-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/richfaces-issues