集成Spring Webflow 2和Apache Tiles [英] Integrating Spring Webflow 2 and Apache Tiles

查看:93
本文介绍了集成Spring Webflow 2和Apache Tiles的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近已经开始升级某些应用程序以使用Spring Webflow 2,并且我想利用Webflow 2随附的新Ajax功能.有人可以指导我如何将Tiles 2与Spring Webflow集成的教程(因为这显然是他们的建议).我发现Webflow 2随附的文档在这方面是绝对没有用的.

I've recently started upgrading some applications to use Spring Webflow 2, and I want to make use of the new Ajax functionality that comes with Webflow 2. Can somebody please direct me to a tutorial for integrating Tiles 2 with Spring Webflow (since that's apparently what they recommend). I've found the documentation that comes with Webflow 2 in this regard to be absolutely useless.

推荐答案

这是我为使其与Webflow 2和tile 2.0一起使用所做的工作

This is what I did to get it working with webflow 2 and tiles 2.0

<bean id="tilesConfigurer"
    class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
    <property name="definitions">
        <list>
            <value>/WEB-INF/tiles-defs/templates.xml</value>
        </list>
    </property>
</bean>

<bean id="urlMapping"
    class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props>
            <prop key="/flow/**/*.html">
                flowController
            </prop>
            <prop key="/**/*.html">viewController</prop>
        </props>
    </property>
    <property name="order" value="1" />
</bean>

<bean id="tilesViewResolver"
    class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass"
        value="org.springframework.web.servlet.view.tiles2.TilesView" />
</bean>

<bean id="flowController"
    class="org.springframework.webflow.mvc.servlet.FlowController">
    <property name="flowExecutor" ref="flowExecutor" />
</bean>

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

<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices"
    base-path="/WEB-INF/flow/user">
    <webflow:flow-location path="/manage-users.xml" />
</webflow:flow-registry>


<webflow:flow-builder-services id="flowBuilderServices"
    view-factory-creator="viewFactoryCreator" />

<bean id="viewFactoryCreator"
    class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
    <property name="viewResolvers" ref="tilesViewResolver" />
</bean>

这篇关于集成Spring Webflow 2和Apache Tiles的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆