可以看看有关Servlet基本原理的一些书

解决方案 »

  1.   

    好象servlet的web.xml与此有不同吧
    我想问的是比如说contextConfigLocation代表的是什么
    希望前辈们能帮忙解答下
      

  2.   

    自己去看web.xml的规范定义。
    关于你说的contextConfigLocation这个跟上面的
    <context-param >
    <param-name >contextConfigLocation </param-name >
    <param-value >/WEB-INF/spring-hibernate.xml </param-value >
    </context-param > 
    有关系,它通过param-name来指定param-value,进而通过name来取得value指定的文件的内容
      

  3.   

    参考:http://www.agilesource.org
      

  4.   

    <context-param > 
    <param-name >contextConfigLocation </param-name > 
    <param-value >/WEB-INF/spring-hibernate.xml </param-value > 
    </context-param > 
    <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 > 
    红色的是有联系的,就是可以整合spring了。
    另外两个是struts2的过滤器类吧,和struts的ActionServlet类是一个作用吧。
      

  5.   

    使servlet能够通过使用org.springframework.web.context.support.WebApplicationContextUtils,
     从 ServletContext中取得org.springframework.web.context.WebApplicationContext,具备了使用spring容器的功能