Spring WebFlow 2和Apache Tiles 3配置。第二种观点不起作用。

时间:2016-09-11 19:26:33

标签: spring spring-mvc spring-webflow spring-webflow-2 apache-tiles

我无法使用apache磁贴配置webflow。 显示第一个视图,但第二个视图显示

  

HTTP状态404 - 请求的资源不可用。

用SpringMVC-调度-servlet.xml中

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

    <var name="order" class="com.rog.webshop.model.order.Order" />

    <action-state id="addCartToOrder">
        <evaluate expression="cartService.validate(requestParameters.cartId)"
                  result="order.cart" />
        <transition to="InvalidCartWarning"
                    on-exception="com.rog.webshop.exception.InvalidCartException" />
        <transition to="collectCustomerInfo" />
    </action-state>

    <view-state id="collectCustomerInfo" view="collectCustomerInfo" model="order">
        <!--<binder>-->
            <!--<binding property="customer.customerId" required="true"  />-->
            <!--<binding property="customer.name" required="true" />-->
            <!--<binding property="customer.billingAddress" required="true" />-->
            <!--<binding property="customer.phoneNumber" required="true" />-->
        <!--</binder>-->
        <transition on="customerInfoCollected" to="collectShippingDetail" />
    </view-state>

    <view-state id="collectShippingDetail"  view="collectShippingDetail" model="order">
        <transition on="shippingDetailCollected" to="orderConfirmation" />
        <transition on="backToCollectCustomerInfo" to="collectCustomerInfo" />
    </view-state>

    <view-state id="orderConfirmation" view="orderConfirmation">
        <transition on="orderConfirmed" to="processOrder" />
        <transition on="backToCollectShippingDetail" to="collectShippingDetail" />
    </view-state>

    <action-state id="processOrder" >
        <evaluate expression="orderService.saveOrder(order)" result="order.orderId"/>
        <transition to="thankCustomer" />
    </action-state>

    <view-state id="InvalidCartWarning" view="InvalidCartWarning">
        <transition to="endState"/>
    </view-state>

    <view-state id="thankCustomer" model="order" view="thankCustomer">
        <transition to="endState"/>
    </view-state>

    <end-state id="endState"/>

    <end-state id="cancelCheckout" view = "checkOutCancelled.jsp"/>

    <global-transitions>
        <transition on = "cancel" to="endState" />
    </global-transitions>

</flow>

我的流程

    <definition name="collectCustomerInfo" extends="shop.base">
    <put-attribute name="title" value="Shop homepage"></put-attribute>
    <put-attribute name="body" value="/WEB-INF/flows/checkout/collectCustomerInfo.jsp"></put-attribute>
</definition>


<definition name="collectShippingDetail" extends="shop.base">
    <put-attribute name="title" value="Shop homepage"></put-attribute>
    <put-attribute name="body" value="/WEB-INF/flows/checkout/collectShippingDetail.jsp"></put-attribute>
</definition>

我在流程中使用的两个视图的平铺定义:

                <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <input type="submit" id="btnAdd" class="btn btn-primary"
                        value="Add" name="_eventId_customerInfoCollected" />
                    <button id="btnCancel" class="btn btn-default" name="_eventId_cancel">Cancel</button>
                </div>
            </div>

这就是我如何唤起jsp中从第一个视图到第二个视图的转换(从collectCustomerInfo到collectShippingDetail

dfs.datanode.http.address

2 个答案:

答案 0 :(得分:0)

尝试使用:

<bean id="tilesViewResolver" class="org.springframework.js.ajax.AjaxUrlBasedViewResolver">
    <property name="viewClass" value="org.springframework.webflow.mvc.view.FlowAjaxTiles3View"/>
</bean>

看看你是否得到了不同的结果

答案 1 :(得分:0)

可能会有所帮助

/v1/search