日期:2014-05-20  浏览次数:20668 次

spring 管理struts2.0和hibernate3.0 需要哪些配置文件?
spring 管理struts2.0和hibernate3.0 需要哪些配置文件?
applicationContext.xml配置文件里面的配置属性每行都是什么意思?
web.xml文件怎么配置spring ?
请高手帮助解释下!谢谢.....

------解决方案--------------------
web.xml
Java code
<filter>
        <filter-name>openSession</filter-name>
        <filter-class>
            org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
        </filter-class>
        <init-param>
            <param-name>flushMode</param-name>
            <param-value>AUTO</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>openSession</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>


    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>
            org.apache.struts2.dispatcher.FilterDispatcher
        </filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>