|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ervacon.springframework.web.servlet.mvc.webflow.SimpleWebFlow
Simple web flow implementation. This class reads a web flow definition conforming to the web flow DTD from a specified resource. This implementation uses JDOM to access the XML flow definition. Several extension hook methods are provided in case a subclass wants to fine tune the behaviour of this class.
A web flow is configured in the Spring application context as a normal bean. Note that this flow implementation is thread safe: all state is initialized when the bean is created by the Spring application context. Once this is done, all state is read only. The modifiable state associated with a flow is stored in a seperate web flow memento that is associated with each active flow used by a client. The client (e.g. a controller implementation) is responsible for correct management of this memento.
Normally you should not use this class directly from within a web application.
Instead, you use the provided WebFlowController to use and drive
the flow.
Exposed configuration properties
| name | default | description |
| webFlowResource | null | Specifies the resource from which the flow definition is loaded. |
WebFlowMemento,
WebFlowController| Field Summary | |
protected org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
SimpleWebFlow()
|
|
| Method Summary | |
void |
afterPropertiesSet()
|
org.springframework.web.servlet.ModelAndView |
execute(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String state,
java.lang.String event,
WebFlowMementoStack mementos)
Execute an event in a state of the web flow. |
protected org.springframework.web.servlet.ModelAndView |
executeActionState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
Execute given action state. |
protected org.springframework.web.servlet.ModelAndView |
executeEndState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
Execute given end state. |
protected org.springframework.web.servlet.ModelAndView |
executeFlowState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
Execute given flow state. |
protected org.springframework.web.servlet.ModelAndView |
executeState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
Execute given state. |
protected org.springframework.web.servlet.ModelAndView |
executeState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String state,
WebFlowMementoStack mementos)
Execute specified state. |
protected org.springframework.web.servlet.ModelAndView |
executeViewState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
Execute given view state. |
protected org.jdom.Element |
findStateDef(java.lang.String state)
Find the state definition for specified state. |
protected org.jdom.Element |
findTransitionDef(org.jdom.Element stateDef,
java.lang.String event)
Find the transition definition linked with specified event in given state definition. |
org.springframework.context.ApplicationContext |
getApplicationContext()
|
java.lang.String |
getName()
Return the name of this web flow. |
org.springframework.core.io.Resource |
getWebFlowResource()
Get the resource from which the web flow is loaded. |
void |
load()
Load the web flow definition from the resource specified by the "webFlowResource" property. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setWebFlowResource(org.springframework.core.io.Resource webFlowResource)
Set the resource from which the web flow is loaded. |
org.springframework.web.servlet.ModelAndView |
start(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
WebFlowMementoStack mementos)
Start the web flow. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected final org.apache.commons.logging.Log log
| Constructor Detail |
public SimpleWebFlow()
| Method Detail |
public org.springframework.core.io.Resource getWebFlowResource()
Get the resource from which the web flow is loaded.
public void setWebFlowResource(org.springframework.core.io.Resource webFlowResource)
Set the resource from which the web flow is loaded.
public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.Exception
public void load()
throws WebFlowException
Load the web flow definition from the resource specified by the "webFlowResource" property.
WebFlowExceptionpublic org.springframework.context.ApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic java.lang.String getName()
Return the name of this web flow. This is configured in the flow definition.
public org.springframework.web.servlet.ModelAndView start(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
WebFlowMementoStack mementos)
throws WebFlowException
WebFlowStart the web flow.
start in interface WebFlowrequest - current HTTP requestresponse - current HTTP responsemementos - flow call stack
WebFlowException - in case of error
public org.springframework.web.servlet.ModelAndView execute(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String state,
java.lang.String event,
WebFlowMementoStack mementos)
throws WebFlowException
WebFlowExecute an event in a state of the web flow.
execute in interface WebFlowrequest - current HTTP requestresponse - current HTTP responsestate - state in which the event should be triggeredevent - event that should be signaledmementos - flow call stack
WebFlowException - in case of errorprotected org.jdom.Element findStateDef(java.lang.String state)
Find the state definition for specified state. Returns null if the state cannot be found.
protected org.jdom.Element findTransitionDef(org.jdom.Element stateDef,
java.lang.String event)
Find the transition definition linked with specified event in given state definition. Returns null if there is no such transition.
protected org.springframework.web.servlet.ModelAndView executeState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String state,
WebFlowMementoStack mementos)
throws WebFlowException
Execute specified state.
request - current HTTP requestresponse - current HTTP responsestate - the state to executemementos - flow call stack
WebFlowException - in case of error
protected org.springframework.web.servlet.ModelAndView executeState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
throws WebFlowException
Execute given state.
request - current HTTP requestresponse - current HTTP responsestateDef - definition of the state to executemementos - flow call stack
WebFlowException - in case of error
protected org.springframework.web.servlet.ModelAndView executeViewState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
throws WebFlowException
Execute given view state. This will return the model and view to render.
request - current HTTP requestresponse - current HTTP responsestateDef - definition of the state to executemementos - flow call stack
WebFlowException - in case of error
protected org.springframework.web.servlet.ModelAndView executeActionState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
throws WebFlowException
Execute given action state. This will execute all actions defined for the state untill a transition is triggered. Once that happens, a transition to the target state is done.
request - current HTTP requestresponse - current HTTP responsestateDef - definition of the state to executemementos - flow call stack
WebFlowException - in case of error
protected org.springframework.web.servlet.ModelAndView executeFlowState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
throws WebFlowException
Execute given flow state. This will load and execute a sub flow and do the necessary mapping to the sub flow model.
request - current HTTP requestresponse - current HTTP responsestateDef - definition of the state to executemementos - flow call stack
WebFlowException - in case of error
protected org.springframework.web.servlet.ModelAndView executeEndState(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.jdom.Element stateDef,
WebFlowMementoStack mementos)
throws WebFlowException
Execute given end state. This terminates the flow and does the necessary mapping to the parent flow if there is one.
request - current HTTP requestresponse - current HTTP responsestateDef - definition of the state to executemementos - flow call stack
WebFlowException - in case of errorpublic java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||