Results 1 to 8 of 8

Thread: Webflow2 - Struts tutorial

  1. #1

    Default Webflow2 - Struts tutorial

    Hi,

    Any tutorial/help of integrating webflow with Struts will be helpful.

    Thanks in advance

  2. #2
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    We don't have a tutorial yet, but the preview 2 release of Spring Web Flow includes a sample application that demonstrates Struts integration: the BirthDate sample.

    Erwin

  3. #3

    Default

    Thanks

  4. #4

    Default

    Please could you tell me what changes are required to the Phonebook and SellItem samples to make them work with Struts.

    I have looked through the Birthdate Example. But when I refresh or Go back I get the session expired problem.

    But this does not happen in the SellItem and Phonebook examples.

    Please could you guide me.

    Thanks in advance.

  5. #5
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    For Struts integration, just follow what the BirthDate sample does.

    The SellItem sample app uses continuations to be able to handle refresh and browser back button use. Here's how it configures the flow execution manager to make use of a continuations based flow execution storage strategy:
    Code:
    <bean id="frontController" name="/pos.htm" class="org.springframework.web.flow.mvc.FlowController">
    	<property name="flowExecutionManager" ref="flowExecutionManager"/>
    </bean>
    
    <bean id="flowExecutionManager" class="org.springframework.web.flow.execution.servlet.HttpServletFlowExecutionManager">
    	<property name="flowExecutionStorage">
    		<bean class="org.springframework.web.flow.execution.servlet.HttpSessionContinuationFlowExecutionStorage"/>
    	</property>
    	<!-- 
    	<property name="flowExecutionStorage">
    		<bean class="org.springframework.web.flow.execution.servlet.HttpSessionFlowExecutionStorage"/>
    	</property>
    	-->
    	<!-- 
    	<property name="flowExecutionStorage">
    		<bean class="org.springframework.web.flow.execution.ClientContinuationFlowExecutionStorage">
    			<property  name="compress"><value>true</value></property>
    		</bean>
    	</property>
    	-->
    </bean>
    Erwin

  6. #6

    Default

    Thanks,

    For org.springframework.web.flow.mvc.FlowController we can set the flowExecutionManager property how do we do it for a Struts FlowAction ??

  7. #7
    Join Date
    Sep 2004
    Location
    Leuven, Belgium
    Posts
    1,853

    Default

    Good point

    Sinds you don't have dependency injection in Struts for actions, you'll have to subclass the FlowAction and override the createFlowExecutionManager method. Something like this:

    Code:
    protected HttpServletFlowExecutionManager createFlowExecutionManager&#40;ActionMapping mapping&#41; &#123;
    	HttpServletFlowExecutionManager manager = super.createFlowExecutionManager&#40;mapping&#41;;
    	manager.setFlowExecutionStorage&#40;new HttpSessionContinuationFlowExecutionStorage&#40;&#41;&#41;;
    	return manager;
    &#125;
    Erwin

  8. #8

    Default

    Thanks for everything.

    It would be very kind of you if you could give me a more detailed explaination. ( code from any other application on smilar lines could be extreamly helpful)

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Replies: 4
    Last Post: Aug 1st, 2005, 03:45 PM
  3. Spring managed Struts Actions
    By drc in forum Web
    Replies: 2
    Last Post: Jul 14th, 2005, 10:46 AM
  4. Replies: 2
    Last Post: May 24th, 2005, 11:22 AM
  5. Replies: 10
    Last Post: Nov 2nd, 2004, 09:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •