看一下文章说要在STRUTS的配置文件中加入插件
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"value="classpath:applicationContext.xml" />
</plug-in>我想如果不加入插件,而是用以下方法: <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/classpath:pplicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
达到的效果是不是一样的呢???
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"value="classpath:applicationContext.xml" />
</plug-in>我想如果不加入插件,而是用以下方法: <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/classpath:pplicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
达到的效果是不是一样的呢???
解决方案 »
- 关于Aptana插件如何让它支持JQuery提示
- Java删除文件 老报错
- jacob操作dll,取ref回调函数
- 面试题目,技术和非技术的
- 请问一下 基于xml的web框架有哪些?
- Struts+Hibernate,做两级别下拉列表连动的问题,解决立即结贴
- 求救:在CMP中,布署时出现:The administration server has dropped the connection?怎么解决啊?
- tomcat 下载中文文件名 文件时找不到文件的问题
- tomcat成功启动,访问却出现访问权限问题?
- 关于单例模式的一个问题
- 实现一个注册功能时报的错,大家帮帮忙看看是什么意思!!!
- hibernate如何调用存储过程
<param-name>contextConfigLocation</param-name>
<param-value>/classpath:pplicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
这个配置是当web窗口启动时同时启动Spring容器,与集成Struts无关。Spring 集成 Struts有两种方法:
第一种就是楼主说的插件模式,把Spring当作Struts1.x的插件
第二种就是更换控制器,Struts1.x有个默认的控制器,现在通过下面的配置换成Spring的控制器,从而将Struts的action当作bean交给Spring管理:
<controller>
<set-property property="processorClass" value="org.springframework.web.struts.DelegatingRequestProcessor"/>
</controller>
一般都用第二种方案。