Hey guys,
i want to implement a simple breadcrumb with spring webflow.
I tried this tutorial: blog/ind...g-webflow-104/
I set up the required class which implements FlowExecutionListener and I also understood what I copied but I don't know how to run this code.
How can I instance this FlowExecutionListener and configure it that any site of my application will be mapped?
In this tutorial I had to create a xml flow definition file, but I don't know how to tell the framework to load it and to bind the FlowExecutionListener to the framework.
I just want a simple breadcrumb like this: Start -gt; Products -gt; Product1
Thx for any answers and sorry for my english
Code:
lt;flow:executor id=quot;flowExecutorquot; registry-ref=quot;flowRegistryquot;gt;
lt;flow:execution-listenersgt;
lt;flow:listener ref=quot;breadcrumbListenerquot;
criteria=quot;flow1, flow2, flow3quot; /gt;
lt;/flow:execution-listenersgt;
lt;/flow:executorgt;
lt;bean id=quot;breadcrumbListenerquot;
class=quot;your.package.BreadcrumbFlowExecutionListenerquot;gt;
lt;/beangt;
Where the criteria flow1, flow2 etc are the first part of the flow file name for each flow you want the listener to be active for.
Good luck,
Chris
Thx for your reply chris.
I forgot to say that i am using Spring Web MVC and just need to use WebFlow for implementing a breadcrumb.
I tried following but my listener still isn't listen:
lt;bean id=quot;flowControllerquot;
class=quot;org..webflow.executor.mvc.Fl owControllerquot;gt;
lt;property name=quot;flowExecutorquot; ref=quot;flowExecutorquot;/gt;
lt;/beangt;
lt;bean id=quot;breadcrumbListenerquot;
class=quot;path.to.my.listenerquot;gt;
lt;/beangt;
lt;flow:executor id=quot;flowExecutorquot; registry-ref=quot;flowRegistryquot;gt;
lt;flow:execution-listenersgt;
lt;flow:listener ref=quot;breadcrumbListenerquot;
criteria=quot;flow-1quot; /gt;
lt;/flow:execution-listenersgt;
lt;/flow:executorgt;
lt;flow:registry id=quot;flowRegistryquot;gt;
lt;flow:location path=quot;/WEB-INF/flows/flow-*.xmlquot;/gt;
lt;/flow:registrygt;
If you are using Spring MVC then trying to use Spring Webflow to implement a breadcrumb will incur complexity you probably do not need, I suggest you look at alternate ways of generating a breadcrumb.
I breadcrumb flow execution listener will only work if you are using Spring Webflow as the controller of your web app (you have flows with view-states, action-states, etc), it sounds from what you saying that Spring MVC is the controller and you have no webflows?
Chris
Thanks in advance.
-Hament. |