Announcement Announcement Module
Collapse
No announcement yet.
Webflow2 - Struts tutorial Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Webflow2 - Struts tutorial

    Hi,

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

    Thanks in advance

  • #2
    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

    Comment


    • #3
      Thanks

      Comment


      • #4
        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.

        Comment


        • #5
          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

          Comment


          • #6
            Thanks,

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

            Comment


            • #7
              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

              Comment


              • #8
                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)

                Comment

                Working...
                X