spring+hibernate_struts整合出现问题!

来源:百度知道 编辑:UC知道 时间:2024/06/27 08:37:36
我在struts-config.xml配置了
<controller
processorClass="org.springframework.web.struts.DelegatingRequestProcessor"></controller>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/classes/applicationContext.xml" />
</plug-in>
在web.xml配置了
<context-param>
param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml
</param-value>
</context-param>
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

看下你的配置文件什么地方出错了把它<plug-in
className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/classes/applicationContext.xml" />
</plug-in>换成
<controller inputForward="true"
processorClass="org.springframework.web.struts.DelegatingRequestProcessor" />试试

看看你的web容器的版本,不建议使用此方式加载controller控制器