1

Please bear with me as this is my first question. Let me know what I can do to improve future questions.

I am trying to learn Spring Webflow, and am slowly wrapping my head around it. I am finding that there are a lot of conventions that the programmer is expected to "just know", and the examples online don't seem to work.

I have cobbled together one example that works as expected, but now I am trying to extend my understanding to the next level in another small project, with my long term goal being a much more complex application. The goal of this exercise is to build a login system that supports different types of client (phone, desktop, etc) with different webflows.

As near as I can tell, I am having trouble configuring the flow registry, probably because I am misunderstanding the convention.

The textbook example I am emulating is this:

<!-- The registry of executable flow definitions -->
<webflow:flow-registry flow-builder-services="flowBuilderServices"
            id="flowRegistry" base-path="/WEB-INF/flows/">
            <webflow:flow-location path="/welcome/welcome.xml" />
</webflow:flow-registry>

My configuration is this:

<!-- The registry of executable flow definitions -->
<webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices"
    base-path="/WEB-INF/pages/">
    <webflow:flow-location path="d/login.xml" />
    <webflow:flow-location path="d/signup.xml" />
</webflow:flow-registry>

The log states:

DEBUG o.s.w.d.r.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/pages/d/login.xml]' under id 'd'

DEBUG o.s.w.d.r.FlowDefinitionRegistryImpl - Registering flow definition 'ServletContext resource [/WEB-INF/pages/d/signup.xml]' under id 'd'

Since, under the covers, the flow registry is a simple HashMap, only one of the flow files is being registered, and not as what I would expect.

What am I missing?

pojo-guy
  • 966
  • 1
  • 12
  • 39

1 Answers1

0

Change configuration as mentioned below, this might help you:

<webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices"
    base-path="/WEB-INF/pages">
    <webflow:flow-location path="/d/login.xml" />
    <webflow:flow-location path="/d/signup.xml" />
</webflow:flow-registry>

also see Spring Webflow - How to Get List of FLOW IDs

Community
  • 1
  • 1
saeid rastak
  • 325
  • 2
  • 11
  • This has the same result. I suspect that the textbook example works only because the directory name and the name of the xml file are the same. I will just have to change how I planned to organize stuff to match spring-webflow's best practices. Thanks! – pojo-guy Jan 08 '15 at 19:39