webwork2.x 集成 spring

支持最好的一种方法
一、在webwork.properties配置
webwork.objectFactory = spring
webwork.devMode = true
webwork.action.extension=dhtml
二、在web.xml中加入
<context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/context/db/datasource.xml,/WEB-INF/context/news/news.xml</param-value>
    </context-param>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
//这段是处理编码用的
<filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>
/*</url-pattern>
    </filter-mapping>

<listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

lunzi   2008-04-14 00:05:42 评论:0   阅读:482   引用:0

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog