0

I'm trying to use Spring-webflow in relation with Spring-MVC. I followed the steps mentionned in the Spring reference and I have access to the first page, wich has the following code :

<%@page isELIgnored="false" %>
<html>
<head>
<title>Import</title>
</head>
<body>
    <a href="${flowExecutionUrl}&_eventId=facebook">Import facebook
        datas</a>
</body>
</html>

However, it redirects me to localhost/myAPP/&_eventId=facebook, with a 404 error in gift.

Here are my servlet configuration file :

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"
    xmlns:webflow="http://www.springframework.org/schema/webflow-config"
    xsi:schemaLocation="
            http://www.springframework.org/schema/mvc               http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
            http://www.springframework.org/schema/beans             http://www.springframework.org/schema/beans/spring-beans-3.0.xsd    
            http://www.springframework.org/schema/webflow-config    http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd    
            http://www.springframework.org/schema/context           http://www.springframework.org/schema/context/spring-context-3.0.xsd">


    <import resource="properties.xml" />

    <context:component-scan base-package="com.dynamease.web.social" />
    <context:annotation-config />

    <mvc:annotation-driven />

    <mvc:interceptors>
        <bean class="com.dynamease.entity.springsocialentities.UserInterceptor">
            <constructor-arg ref="usersConnectionRepository" />
        </bean>
    </mvc:interceptors>

    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/" />
        <property name="suffix" value=".jsp" />
    </bean>
    <bean id="viewResolverImport"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/import/" />
        <property name="suffix" value=".jsp" />
    </bean>

    <!-- Allows users to sign-in with their provider accounts. -->
    <bean class="org.springframework.social.connect.web.ProviderSignInController">
        <constructor-arg ref="connectionFactoryLocator" />
        <constructor-arg ref="usersConnectionRepository" />
        <constructor-arg>
            <bean class="com.dynamease.entity.springsocialentities.SimpleSignInAdapter" />
        </constructor-arg>
    </bean>


    <mvc:view-controller path="/signin" />
    <mvc:view-controller path="/signout" />
    <mvc:view-controller path="/import/import"/>

    <!-- Spring web flow -->
    <bean id="viewFactoryCreator"
        class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
        <property name="viewResolvers" ref="viewResolverImport" />
    </bean>
    <webflow:flow-builder-services id="flowBuilderServices"
        view-factory-creator="viewFactoryCreator" />

    <webflow:flow-registry id="flowRegistry"
        flow-builder-services="flowBuilderServices">
        <webflow:flow-location path="/web-INF/views/import/registryImport.xml" />
    </webflow:flow-registry>

    <webflow:flow-executor id="flowExecutor"
        flow-registry="flowRegistry" />

    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
        <property name="flowExecutor" ref="flowExecutor" />
    </bean>
    <bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
        <property name="flowRegistry" ref="flowRegistry"/>
        <property name="order" value="0" />
    </bean>
</beans>

And here is my webflow configuration file :

<?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-2.0.xsd">

    <view-state id="import" view="import.jsp">
        <transition on="facebook" to="facebook" />
    </view-state>

    <end-state id="facebook" />
</flow>

I guess I fail somewhere in the url resolvers, but I can't say where. Any ideas ?

4

1 回答 1

0

它会将您重定向到 *localhost/myAPP/&_eventId=faceboo* 但它应该看起来像这样:

localhost/myAPP/registryImport?execution=s1e1&_eventId=facebook

带有此链接的页面上浏览器显示的地址是什么?你如何开始你的流程?

于 2013-06-28T09:53:32.690 回答