Results 1 to 2 of 2

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

  1. #1
    Join Date
    Jun 2005
    Posts
    2

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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
    Keith Donald
    Core Spring Development Team

Similar Threads

  1. Replies: 2
    Last Post: Jul 8th, 2008, 04:17 AM
  2. Replies: 0
    Last Post: Sep 29th, 2005, 09:37 AM
  3. quick start guide?
    By crimsondr in forum SpringSource Tool Suite
    Replies: 3
    Last Post: Jun 15th, 2005, 08:42 AM
  4. FreeMarker vs Velocity
    By Martin Kersten in forum Architecture
    Replies: 8
    Last Post: May 30th, 2005, 09:21 AM
  5. Replies: 4
    Last Post: Mar 28th, 2005, 04:00 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
  •