2007-06-28
Struts注册Spring Context的三种方式
(1)使用Struts插件
在struts-config.xml中
<plug-in className="org.springframework.web.struts.ContextLoaderPlugin">
<set-property property="contextConfigLocation"
value="applicationContext.xml"/>
</plug-in>(2)在web.xml中使用Listener
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContextxml,
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> (2)在web.xml中使用Servlet
<servlet-name>springInitServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>0</load-on-startup>
发表评论
- 浏览: 84489 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
Static初始化代码快访问st ...
当然啦,final型常量只能被赋值一次
-- by Chihom -
Tomcat 5.5不能使用EL表达 ...
請在web.xml修改XSD<?xml version="1.0" enc ...
-- by trowa -
一个通用的泛型GenericH ...
谢谢!使用中!
-- by sangood -
Spring AOP四种创建通知( ...
我一直想知道如何拦截某个类中特定的方法,而不是所有的方法?
-- by yourgame -
HashTable和HashMap的区 ...
这么多总结,还算你的这个不错,谢谢,学习
-- by lysmart_8






评论排行榜