in meiner Anwendung gibt es unterschiedliche Federprofile: Entwicklung, Test, ...Register unterschiedliche Strömungen abhängig von Feder Profil
Die Frage ist, gibt es eine Möglichkeit, einen Fluss in Abhängigkeit von der Aktivierung registrieren Federprofil?
Zum Beispiel habe ich die Flüsse: aFlow.xml, bFlow.xml.
Wenn Federprofilentwicklung aktiviert ist, möchte ich so etwas wie
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path=".../aFlow.xml" />
</webflow:flow-registry>
und wenn Federprofiltest aktiviert ist, dann will ich so etwas wie
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path=".../aFlow.xml" />
<webflow:flow-location path=".../bFlow.xml" />
</webflow:flow-registry>
Hintergrund: Wenn die Federprofilentwicklung ist aktiviert ist, ist die bFlow.xml möglicherweise nicht zugänglich. Wenn der Federprofiltest aktiviert ist, sollten aFlow.xml und bFlow.xml zugänglich sein.
Derzeit habe ich die folgende Lösung. Ich definiere
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path=".../aFlow.xml" />
</webflow:flow-registry>
<webflow:flow-registry id="flowRegistryTest" flow-builder-services="flowBuilderServices" parent="flowRegistry">
<webflow:flow-location path=".../bFlow.xml" />
</webflow:flow-registry>
und verschiedene FlowHandlerMapping zur Verwendung auf dem Federprofil abhängig:
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
<property name="flowRegistry" ref="flowRegistry"/>
<property name="defaultHandler">
<!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named
"intro" -->
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
</property>
</bean>
<beans profile="test">
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping" primary="true">
<property name="flowRegistry" ref="flowRegistryTest"/>
<property name="defaultHandler">
<!-- If no flow match, map path to a view to render; e.g. the "/intro" path would map to the view named
"intro" -->
<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
</property>
</bean>
</beans>
Vielen Dank im Voraus!