diff --git a/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpression.java b/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpression.java index 49e7b137..1d4bf8e7 100644 --- a/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpression.java +++ b/spring-binding/src/main/java/org/springframework/binding/expression/el/ELExpression.java @@ -35,7 +35,11 @@ public class ELExpression implements Expression { public Object getValue(Object context) throws EvaluationException { ELContext ctx = elContextFactory.getELContext(context); try { - return valueExpression.getValue(ctx); + Object result = valueExpression.getValue(ctx); + if (result == null && !ctx.isPropertyResolved()) { + throw new EvaluationException(new EvaluationAttempt(this, context), null); + } + return result; } catch (ELException ex) { throw new EvaluationException(new EvaluationAttempt(this, context), ex); } @@ -45,6 +49,9 @@ public class ELExpression implements Expression { ELContext ctx = elContextFactory.getELContext(context); try { valueExpression.setValue(ctx, value); + if (!ctx.isPropertyResolved()) { + throw new EvaluationException(new EvaluationAttempt(this, context), null); + } } catch (ELException ex) { throw new EvaluationException(new EvaluationAttempt(this, context), ex); } diff --git a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java index 3edacd64..57b9abdb 100644 --- a/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java +++ b/spring-faces/src/main/java/org/springframework/faces/expression/CompositeFlowVariableResolver.java @@ -3,10 +3,12 @@ package org.springframework.faces.expression; import javax.el.CompositeELResolver; import javax.faces.el.VariableResolver; +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; /** * Assembles {@link RequestContextELResolver} and {@link ScopeSearchingELResolver} into a composite that may be used @@ -20,6 +22,9 @@ public class CompositeFlowVariableResolver extends ELDelegatingVariableResolver static { composite.add(new RequestContextELResolver()); + if (ClassUtils.isPresent("org.springframework.security.context.SecurityContextHolder")) { + composite.add(new SpringSecurityELResolver()); + } composite.add(new SpringBeanWebFlowELResolver()); composite.add(new ImplicitFlowVariableELResolver()); composite.add(new ScopeSearchingELResolver()); diff --git a/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java b/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java index a759b586..148c7936 100644 --- a/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java +++ b/spring-faces/src/main/java/org/springframework/faces/ui/AjaxViewRoot.java @@ -20,6 +20,7 @@ import javax.faces.event.PhaseId; import org.springframework.util.Assert; import org.springframework.util.StringUtils; +import org.springframework.webflow.execution.View; /** * Customizes the behavior of an existing UIViewRoot with Ajax-aware processing. @@ -42,7 +43,7 @@ public class AjaxViewRoot extends DelegatingViewRoot { private String[] renderIds; - private static final String RENDER_IDS_EXPRESSION = "#{renderIds}"; + private static final String RENDER_IDS_EXPRESSION = "#{" + View.RENDER_FRAGMENTS_ATTRIBUTE + "}"; private final ValueBinding renderIdsExpr; @@ -267,12 +268,11 @@ public class AjaxViewRoot extends DelegatingViewRoot { if (renderIds == null) { FacesContext context = FacesContext.getCurrentInstance(); - String renderIdsValue = (String) renderIdsExpr.getValue(context); - if (StringUtils.hasText(renderIdsValue)) { - renderIds = StringUtils.delimitedListToStringArray(renderIdsValue, ",", " "); - renderIds = removeNestedChildren(context, getRenderIds()); - } else { + renderIds = (String[]) renderIdsExpr.getValue(context); + if (renderIds == null || renderIds.length == 0) { renderIds = getProcessIds(); + } else { + renderIds = removeNestedChildren(context, renderIds); } } return renderIds; diff --git a/spring-faces/src/test/java/org/springframework/faces/ui/AjaxViewRootTests.java b/spring-faces/src/test/java/org/springframework/faces/ui/AjaxViewRootTests.java index 7b1a7d57..4e687643 100644 --- a/spring-faces/src/test/java/org/springframework/faces/ui/AjaxViewRootTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/ui/AjaxViewRootTests.java @@ -14,6 +14,7 @@ import org.apache.shale.test.mock.MockResponseWriter; import org.springframework.faces.webflow.JSFMockHelper; import org.springframework.faces.webflow.MockViewHandler; import org.springframework.util.StringUtils; +import org.springframework.webflow.execution.View; public class AjaxViewRootTests extends TestCase { @@ -72,7 +73,8 @@ public class AjaxViewRootTests extends TestCase { public void testEncodeAll_RenderIdsExpr() throws IOException { - jsf.externalContext().getRequestMap().put("renderIds", "foo:bar,foo:baz"); + jsf.externalContext().getRequestMap().put(View.RENDER_FRAGMENTS_ATTRIBUTE, + StringUtils.delimitedListToStringArray("foo:bar,foo:baz", ",", " ")); AjaxViewRoot ajaxRoot = new AjaxViewRoot(testTree); diff --git a/spring-webflow-samples/booking-faces/.classpath b/spring-webflow-samples/booking-faces/.classpath index 5e974b0f..a4a4a646 100755 --- a/spring-webflow-samples/booking-faces/.classpath +++ b/spring-webflow-samples/booking-faces/.classpath @@ -1,11 +1,58 @@ - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spring-webflow-samples/booking-faces/.m7project b/spring-webflow-samples/booking-faces/.m7project new file mode 100644 index 00000000..d7fcf628 --- /dev/null +++ b/spring-webflow-samples/booking-faces/.m7project @@ -0,0 +1,16 @@ + + + + src/webapp + com.m7.webapp.java + + + + + + + + + + + diff --git a/spring-webflow-samples/booking-faces/.project b/spring-webflow-samples/booking-faces/.project index 401b88bb..26fdd198 100755 --- a/spring-webflow-samples/booking-faces/.project +++ b/spring-webflow-samples/booking-faces/.project @@ -1,42 +1,30 @@ - - swf-booking-faces - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.wst.common.project.facet.core.builder - - - - - org.eclipse.wst.validation.validationbuilder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - org.hibernate.eclipse.console.hibernateBuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.eclipse.wst.common.project.facet.core.nature - org.eclipse.jdt.core.javanature - org.eclipse.wst.common.modulecore.ModuleCoreNature - org.eclipse.jem.workbench.JavaEMFNature - org.hibernate.eclipse.console.hibernateNature - - + swf-booking-faces + Spring Web Flow Number Guess JSF Example + + + + org.eclipse.jdt.core.javabuilder + + + org.eclipse.wst.common.project.facet.core.builder + + + org.eclipse.wst.validation.validationbuilder + + + org.springframework.ide.eclipse.core.springbuilder + + + org.hibernate.eclipse.console.hibernateBuilder + + + + org.springframework.ide.eclipse.core.springnature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jem.workbench.JavaEMFNature + org.hibernate.eclipse.console.hibernateNature + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/pom.xml b/spring-webflow-samples/booking-faces/pom.xml new file mode 100644 index 00000000..e5280907 --- /dev/null +++ b/spring-webflow-samples/booking-faces/pom.xml @@ -0,0 +1,182 @@ + + + 4.0.0 + org.springframework + swf-booking-faces + war + Spring Web Flow Hotel Booking JSF Example + 2.0-m4-SNAPSHOT + Spring Web Flow Number Guess JSF Example + http://www.springframework.org + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + scm:svn:https://svn.sourceforge.net/svnroot/springframework/spring-projects + scm:svn:https://svn.sourceforge.net/svnroot/springframework/spring-projects + 1.0.2 + http://svn.sourceforge.net/viewcvs.cgi/springframework/spring-projects + + + Spring Framework + http://www.springframework.org/ + + + + java.net + http://download.java.net/maven/1 + legacy + + + jboss + http://repository.jboss.com/maven2 + + + spring-snapshot + Spring Portfolio Snapshot Repository + http://s3.amazonaws.com/maven.springframework.org/snapshot + + + + + log4j + log4j + 1.2.14 + + + taglibs + standard + 1.1.2 + + + javax.servlet + jstl + 1.1.2 + + + com.sun.facelets + jsf-facelets + 1.1.13 + + + aopalliance + aopalliance + 1.0 + + + org.springframework + spring-faces + ${project.version} + + + javax.el + el-api + + + + + org.springframework + spring-webflow + ${project.version} + + + javax.el + el-api + + + + + org.springframework + spring-binding + ${project.version} + + + javax.el + el-api + + + + + org.springframework + spring-aop + 2.5.2 + + + org.springframework + spring-orm + 2.5.2 + + + org.springframework + spring-jdbc + 2.5.2 + + + org.springframework + spring-tx + 2.5.2 + + + org.springframework.security + spring-security-core + 2.0-M2 + + + org.jboss.seam + jboss-el + 2.0.0.GA + + + javax.el + el-api + + + + + org.hibernate + hibernate + 3.2.5.ga + + + org.hibernate + hibernate-entitymanager + 3.3.1.ga + + + hsqldb + hsqldb + 1.8.0.7 + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.5 + 1.5 + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.1 + + + + 7001 + 60000 + + + 10 + + + + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java index a3983e7e..37d2d134 100755 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/BookingService.java @@ -13,7 +13,7 @@ public interface BookingService { * @param username the user's name * @return their bookings */ - public List findBookings(User user); + public List findBookings(String username); /** * Find hotels available for booking by some criteria. @@ -34,4 +34,11 @@ public interface BookingService { * @param id the booking id */ public void cancelBooking(Booking booking); + + /** + * Lookup a user based on their username + * @param username the user's username + * @return the user + */ + public User findUser(String username); } diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java index 6913247c..6dff554c 100755 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/JpaBookingService.java @@ -8,13 +8,14 @@ import javax.persistence.PersistenceContext; import org.springframework.stereotype.Repository; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; /** * A JPA-based implementation of the Booking Service. Delegates to a JPA entity manager to issue data access calls * against the backing repository. The EntityManager reference is provided by the managing container (Spring) * automatically. */ -@Service +@Service("bookingService") @Repository public class JpaBookingService implements BookingService { @@ -27,15 +28,20 @@ public class JpaBookingService implements BookingService { @Transactional(readOnly = true) @SuppressWarnings("unchecked") - public List findBookings(User user) { - return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") - .setParameter("username", user.getName()).getResultList(); + public List findBookings(String username) { + if (username != null) { + return em.createQuery("select b from Booking b where b.user.username = :username order by b.checkinDate") + .setParameter("username", username).getResultList(); + } else { + return null; + } } @Transactional(readOnly = true) @SuppressWarnings("unchecked") public List findHotels(SearchCriteria criteria) { - String pattern = getSearchPattern(criteria); + String pattern = !StringUtils.hasText(criteria.getSearchString()) ? "'%'" : "'%" + + criteria.getSearchString().toLowerCase().replace('*', '%') + "%'"; return em.createQuery( "select h from Hotel h where lower(h.name) like " + pattern + " or lower(h.city) like " + pattern + " or lower(h.zip) like " + pattern + " or lower(h.address) like " + pattern).setMaxResults( @@ -47,11 +53,19 @@ public class JpaBookingService implements BookingService { return em.find(Hotel.class, id); } - // read-write transactional methods + @Transactional(readOnly = true) + public User findUser(String username) { + return (User) em.createQuery("select u from User u where u.username = :username").setParameter("username", + username).getSingleResult(); + } + // read-write transactional methods @Transactional public void cancelBooking(Booking booking) { - em.remove(booking); + booking = em.find(Booking.class, booking.getId()); + if (booking != null) { + em.remove(booking); + } } // helpers diff --git a/spring-webflow-samples/booking-faces/src/main/resources/import.sql b/spring-webflow-samples/booking-faces/src/main/resources/import.sql index 7c57d9d0..cd3a125b 100755 --- a/spring-webflow-samples/booking-faces/src/main/resources/import.sql +++ b/spring-webflow-samples/booking-faces/src/main/resources/import.sql @@ -1,4 +1,6 @@ -insert into Customer (username, password, name) values ('springer', 'springrocks', 'Springer') +insert into Customer (username, name) values ('rod', 'Rod') +insert into Customer (username, name) values ('dianne', 'Dianne') +insert into Customer (username, name) values ('scott', 'Scott') insert into Hotel (id, price, name, address, city, state, zip, country) values (1, 199, 'Westin Diplomat', '3555 S. Ocean Drive', 'Hollywood', 'FL', '33019', 'USA') insert into Hotel (id, price, name, address, city, state, zip, country) values (2, 120, 'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') insert into Hotel (id, price, name, address, city, state, zip, country) values (3, 180, 'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA', '30305', 'USA') diff --git a/spring-webflow-samples/booking-faces/src/main/resources/log4j.xml b/spring-webflow-samples/booking-faces/src/main/resources/log4j.xml index b50d654b..f88f08cb 100644 --- a/spring-webflow-samples/booking-faces/src/main/resources/log4j.xml +++ b/spring-webflow-samples/booking-faces/src/main/resources/log4j.xml @@ -31,6 +31,10 @@ + + + + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml index dd70a167..0a90f896 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking.xml @@ -3,19 +3,21 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> + + - + - + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main.xml index e1ee3d61..48289860 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main.xml @@ -7,7 +7,7 @@ - + @@ -17,7 +17,7 @@ - + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml index 548c96f8..1c605d85 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml @@ -38,7 +38,7 @@ Action - + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml index d1870237..0baf0eff 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml @@ -1,7 +1,8 @@ + xmlns:h="http://java.sun.com/jsf/html" + xmlns:c="http://java.sun.com/jstl/core"> Spring Faces: Hotel Booking Sample Application @@ -21,7 +22,9 @@
Spring Faces: Hotel Booking Sample Application
- Welcome, #{currentUser.name} + + Welcome, ${currentUser.name} +
diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/login.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/login.xhtml new file mode 100755 index 00000000..d9707a5b --- /dev/null +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/login.xhtml @@ -0,0 +1,60 @@ + + + + + + +

Login

+ + +
+ Your login attempt was not successful, try again.

+ Reason: #{sessionScope.SPRING_SECURITY_LAST_EXCEPTION.message} +
+
+ +
+

Valid users:

+
    +
  • rod/koala
  • +
  • dianne/emu
  • +
  • scott/wombat
  • +
+
+ +
+
+
+
+
User:
+
+ + + + +
+
+
+
Password:
+
+ +
+
+
+
Don't ask for my password for two weeks:
+
+ +
+
+
+
+ +
+
+
+ +
+
\ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/logout-success.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/logout-success.xhtml new file mode 100755 index 00000000..51b095af --- /dev/null +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/logout-success.xhtml @@ -0,0 +1,16 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %> + + + + + + +
+

Logout

+

You have successfully logged out.

+
+ + +
+
\ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml index deaabfc1..34984b9e 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web-application-config.xml @@ -5,6 +5,7 @@ xmlns:tx="http://www.springframework.org/schema/tx" xmlns:webflow="http://www.springframework.org/schema/webflow-config" xmlns:faces="http://www.springframework.org/schema/faces-config" + xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd @@ -15,7 +16,9 @@ http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd http://www.springframework.org/schema/faces-config - http://www.springframework.org/schema/faces-config/spring-faces-config-2.0.xsd"> + http://www.springframework.org/schema/faces-config/spring-faces-config-2.0.xsd + http://www.springframework.org/schema/security + http://www.springframework.org/schema/security/spring-security-2.0.xsd"> @@ -35,14 +38,15 @@ - + - + + @@ -61,6 +65,9 @@ + + + @@ -82,5 +89,34 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml index ecb7a943..26e14fdd 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/web.xml @@ -4,6 +4,13 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> + + contextConfigLocation + + /WEB-INF/web-application-config.xml + + + javax.faces.DEFAULT_SUFFIX @@ -21,6 +28,20 @@ facelets.REFRESH_PERIOD 1 + + + springSecurityFilterChain + org.springframework.web.filter.DelegatingFilterProxy + + + + springSecurityFilterChain + /* + + + + org.springframework.web.context.ContextLoaderListener + diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java index 52d64381..4c57653f 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/ImplicitFlowVariableELResolver.java @@ -40,9 +40,6 @@ public class ImplicitFlowVariableELResolver extends ELResolver { return null; } RequestContext requestContext = RequestContextHolder.getRequestContext(); - if (requestContext == null) { - return null; - } if (ImplicitVariables.matches(property)) { context.setPropertyResolved(true); return ImplicitVariables.value(context, requestContext, property); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java index 741d10ef..b3f3310e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/el/SpringBeanWebFlowELResolver.java @@ -18,7 +18,7 @@ public class SpringBeanWebFlowELResolver extends SpringBeanELResolver { protected BeanFactory getBeanFactory(ELContext elContext) { RequestContext rc = RequestContextHolder.getRequestContext(); - if (rc.getActiveFlow().getBeanFactory() != null) { + if (rc != null && rc.getActiveFlow().getBeanFactory() != null) { return rc.getActiveFlow().getBeanFactory(); } else { return EMPTY_BEAN_FACTORY;