可以看看有关Servlet基本原理的一些书
解决方案 »
- struts2+spring+hibernate中保存对象出现空指针异常
- 错误的指令。。。。
- ModelAndView能不能控制窗口大小
- 关于GMAIL邮件的发送
- struts 的问题
- java调用IIS发布的WEB SERVICES问题
- 关于SmartFoxServer2x问题
- 你大家帮我看看这是什么错误?org.apache.jasper.JasperException: /test.jsp(4,54) Unterminated <jsp:useBean> tag
- 数据层的开发方式选择问题
- java搭建以太坊的私有链
- ejb远程调用home类型无法转换,请教高手,急!!
- 急!!!!!在线等待,请教Tomcat服务器得配置和启动问题。
我想问的是比如说contextConfigLocation代表的是什么
希望前辈们能帮忙解答下
关于你说的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指定的文件的内容
<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类是一个作用吧。
从 ServletContext中取得org.springframework.web.context.WebApplicationContext,具备了使用spring容器的功能