### Eclipse Workspace Patch 1.0
#P javaserverfaces-sources
Index: jsf-ri/src/com/sun/faces/el/FacesCompositeELResolver.java
===================================================================
RCS file: /cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/FacesCompositeELResolver.java,v
retrieving revision 1.9
diff -u -r1.9 FacesCompositeELResolver.java
--- jsf-ri/src/com/sun/faces/el/FacesCompositeELResolver.java 17 Dec 2007 21:46:09 -0000 1.9
+++ jsf-ri/src/com/sun/faces/el/FacesCompositeELResolver.java 31 Jan 2010 16:39:27 -0000
@@ -65,12 +65,13 @@
throws ELException {
context.setPropertyResolved(false);
- if (FacesContext.getCurrentInstance() == null) {
+ FacesContext fc = this.getFacesContext(context);
+ if (fc == null) {
return null;
}
- setChainType();
+ setChainType(fc);
Object result = super.getValue(context, base, property);
- clearChainType();
+ clearChainType(fc);
return result;
}
@@ -79,12 +80,13 @@
throws ELException {
context.setPropertyResolved(false);
- if (FacesContext.getCurrentInstance() == null) {
+ FacesContext fc = this.getFacesContext(context);
+ if (fc == null) {
return null;
}
- setChainType();
+ setChainType(fc);
Class> result = super.getType(context, base, property);
- clearChainType();
+ clearChainType(fc);
return result;
}
@@ -93,32 +95,35 @@
public void setValue(ELContext context, Object base, Object property,
Object val) throws ELException {
context.setPropertyResolved(false);
- if (FacesContext.getCurrentInstance() == null) {
+ FacesContext fc = this.getFacesContext(context);
+ if (fc == null) {
return;
}
- setChainType();
+ setChainType(fc);
super.setValue(context, base, property, val);
- clearChainType();
+ clearChainType(fc);
}
public boolean isReadOnly(ELContext context, Object base, Object property)
throws ELException {
context.setPropertyResolved(false);
- if (FacesContext.getCurrentInstance() == null) {
+ FacesContext fc = this.getFacesContext(context);
+ if (fc == null) {
return false;
}
- setChainType();
+ setChainType(fc);
boolean result = super.isReadOnly(context, base, property);
- clearChainType();
+ clearChainType(fc);
return result;
}
public Iterator
true
if the FacesContext is present
+ */
+ private FacesContext getFacesContext(ELContext elContext) {
+ FacesContext ctx = (FacesContext) elContext.getContext(FacesContext.class);
+ if (ctx == null) {
+ ctx = FacesContext.getCurrentInstance();
+ }
+ return ctx;
+ }
+
}