Announcement Announcement Module
Collapse
No announcement yet.
flow problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • flow problem

    hi
    i am jsut starting to work with webflow and i ve got some problem with settings(propably)

    this is how it looks right now:

    WEB-INF/web.xml
    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
        version="2.4">
    
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
    
        <servlet>
            <servlet-name>motor</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>motor</servlet-name>
            <url-pattern>*.htm</url-pattern>
        </servlet-mapping>
    
        <welcome-file-list>
            <welcome-file>hello.htm</welcome-file>
        </welcome-file-list>
    </web-app>

    WEB-INF/motor-servlet.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:flow="http://www.springframework.org/schema/webflow-config"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd
    http://www.springframework.org/schema/webflow-config
    http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd
                    http://www.springframework.org/schema/mvc
                    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
    
    
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/jsp/"/>
            <property name="suffix" value=".jsp"/>
        </bean>
    
        <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
            <property name="flowRegistry" ref="flowRegistry" />
            <property name="order" value="0" />
        </bean>
    
        <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
            <property name="flowExecutor" ref="flowExecutor" />
        </bean>
    
        <bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
            <property name="flowExecutor" ref="flowExecutor"/>
        </bean>
    
        <flow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
    
        <flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
            <flow:flow-location path="/WEB-INF/flows/hello.xml"/>
        </flow:flow-registry>
    
        <!--bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <value>
                    /hello.htm=flowController
                </value>
            </property>
        </bean-->
    
        <flow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator"/>
    
        <bean id="mvcViewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
            <property name="viewResolvers" ref="viewResolver"/>
        </bean>
    </beans>
    WEB-INF/applicationContext.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="
               http://www.springframework.org/schema/beans
               http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
               http://www.springframework.org/schema/context
               http://www.springframework.org/schema/context/spring-context-2.5.xsd">
    
        <context:annotation-config />
    
    </beans>

    AND now propably most important
    /WEB-INF/jsp/index.jsp
    Code:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd"
       >
    
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP</title>
        </head>
        <body>
            <h1>JSP</h1>
            <form>
            <input type="submit" class="button" name="_eventId_go" value="go"/>
            <button name="_eventId_go">Go!</button>
            </form>
            <a href="${flowExecutionUrl}&_eventId=go">go</a>
            
        </body>
    </html>
    WEB-INF/flows/hello.xml
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <flow xmlns="http://www.springframework.org/schema/webflow"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.springframework.org/schema/webflow
                              http://www.springframework.org/schema/webflow/spring-webflow-1.0.xsd">
    
    	<start-state idref="enter"/>
    
    	<view-state id="enter" view="index">
    		<transition on="go" to="hello"/>
    	</view-state>
            <view-state id="hello" view="hello">
    		<transition on="back" to="enter"/>
    	</view-state>
    </flow>
    problem is with flow
    it doesnt work as it should be
    link in jsp page is working correctly but buttons dont work
    only step in addres is changing but it doesnt move me to hello view

    i didnt add here hello.jsp couz it doesnt rly contain anything except some string (just to show me if i am on right page)
Working...
X