Announcement Announcement Module
Collapse
No announcement yet.
newbie: how to make quick start project work with Velocity? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • newbie: how to make quick start project work with Velocity?

    Hello!

    I am a total newbie to the whole idea of Spring/Velocity/Web Flow, but I really want to make sense out of these techniques so may I borrow some of your time for newbie questions?

    I have followed the VelocityAndSpringStepByStep tutorial and everything is working very well. But when I tried to build my first Web Flow project following the Quick Start, I didn't know how to configure the "view" (myFormView and myFormSuccessView) in Velocity...

    I was trying to add the quick start web flow project into the VelocityAndSpringStepByStep project that is already working with Velocity templates. I modified the given myFormView.jsp to be myFormView.vm and added these lines in my springapp-servlet.xml:

    <bean name="/myFlow.htm" class="org.springframework.web.flow.mvc.FlowContro ller">
    <!--property name="flow" ref="myFlow"/-->
    </bean>

    <bean id="myFlow" class="org.springframework.web.flow.config.XmlFlow FactoryBean">
    <property name="location" value="/WEB-INF/my-flow.xml"/>
    </bean>

    <bean id="formAction" class="foo.bar.MyFormAction"/>

    my-flow.xml and the MyFormAction class are both copied from the Quick Start page. And I didn't change anything else in the springapp-servlet.xml from the VelocityAndSpringStepByStep tutorial.

    After redeploy/reload the springapp webapp, all I get at http://localhost:1985/springapp/myFlow.htm is a 404 error...

    So, what should I do to actually make a view (velocity template) to be loaded by the system? Do I need to create a Controller just like the springappController in the Spring/Velocity tutorial for myFlowView? If so, how could this view be used in my Flow?

    I know these questions sound stupid to most of guys here, but please shed some light to me 8) Thanks!

  • #2
    Are you using a view resolver? Turn on logging for org.springframework.web.flow and see if the system is receiving your request first off and spawning a new flow which goes to a view state.

    Also, with the config above you'll need to pass the _flowId of the flow to launch into your request URL as the "/myFlow.htm" is setup to handle all flows for the app.

    so e.g http://localhost:8080/springapp/myfl..._flowId=myFlow

    Keith

    Comment

    Working...
    X