Author: smendenh(a)redhat.com
Date: 2009-07-28 11:07:34 -0400 (Tue, 28 Jul 2009)
New Revision: 11312
Modified:
branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
Log:
Fixes for
https://jira.jboss.org/jira/browse/JBSEAM-3769
Modified:
branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
===================================================================
---
branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java 2009-07-28
15:07:03 UTC (rev 11311)
+++
branches/community/Seam_2_2/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java 2009-07-28
15:07:34 UTC (rev 11312)
@@ -48,10 +48,19 @@
response = new MockHttpServletResponse();
setContextClassLoader();
+
+ // If a FacesContext isn't available, set one up
+ if (FacesContext.getCurrentInstance() == null)
+ {
+ facesContext = RendererFacesContextFactory.instance().getFacesContext(request,
response);
+ }
+ else
+ {
+ facesContext = FacesContext.getCurrentInstance();
+ }
// Generate the FacesContext from the JSF FacesContextFactory
originalFacesContext = FacesContext.getCurrentInstance();
- facesContext = RendererFacesContextFactory.instance().getFacesContext(request,
response);
DelegatingFacesContext.setCurrentInstance(facesContext);
// Create the viewRoot