SWF-527 - org.springframework.faces.webflow.FlowVariableResolver not working with JDK1.4
This commit is contained in:
@@ -23,7 +23,6 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.webflow.expression.el.ImplicitFlowVariableELResolver;
|
||||
import org.springframework.webflow.expression.el.RequestContextELResolver;
|
||||
import org.springframework.webflow.expression.el.ScopeSearchingELResolver;
|
||||
import org.springframework.webflow.expression.el.SpringBeanWebFlowELResolver;
|
||||
import org.springframework.webflow.expression.el.SpringSecurityELResolver;
|
||||
|
||||
/**
|
||||
@@ -42,7 +41,6 @@ public class FlowVariableResolver extends ELDelegatingVariableResolver {
|
||||
if (ClassUtils.isPresent("org.springframework.security.context.SecurityContextHolder")) {
|
||||
composite.add(new SpringSecurityELResolver());
|
||||
}
|
||||
composite.add(new SpringBeanWebFlowELResolver());
|
||||
}
|
||||
|
||||
public FlowVariableResolver(VariableResolver nextResolver) {
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.springframework.faces.webflow;
|
||||
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.el.VariableResolver;
|
||||
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.support.StaticListableBeanFactory;
|
||||
import org.springframework.web.jsf.SpringBeanVariableResolver;
|
||||
import org.springframework.webflow.execution.RequestContext;
|
||||
import org.springframework.webflow.execution.RequestContextHolder;
|
||||
|
||||
/**
|
||||
* JSF 1.1 variable resolver for Spring Beans accessible to the flow's local bean factory.
|
||||
* @author Jeremy Grelle
|
||||
*/
|
||||
public class SpringBeanWebFlowVariableResolver extends SpringBeanVariableResolver {
|
||||
|
||||
private static final BeanFactory EMPTY_BEAN_FACTORY = new StaticListableBeanFactory();
|
||||
|
||||
public SpringBeanWebFlowVariableResolver(VariableResolver originalVariableResolver) {
|
||||
super(originalVariableResolver);
|
||||
}
|
||||
|
||||
protected BeanFactory getBeanFactory(FacesContext facesContext) {
|
||||
RequestContext requestContext = RequestContextHolder.getRequestContext();
|
||||
if (requestContext != null && requestContext.getActiveFlow().getBeanFactory() != null) {
|
||||
BeanFactory factory = requestContext.getActiveFlow().getBeanFactory();
|
||||
return factory;
|
||||
} else {
|
||||
return EMPTY_BEAN_FACTORY;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user