spring与struts2整合出现错误HTTP Status 500 - Unable to instantiate Action
在进行spring和struts2整合的时候因为大意遇到了一个问题,费了半天神终于找到了问题所在,故分享出来望广大博友引以为戒!!
我们都知道在spring和struts2整合时,spring接管了action对象的创建,所以一定要在spring配置文件中配置action,这里需要注意的是配置<bean id="???">中的id时,
要与struts.xml配置action中的<action class="???">class一致,否则就会出现如下问题:

楼主就是因为把struts.xml配置action中的class写成了action类路径,导致了这个问题,所以亲们一定要注意!
错误配置代码:applicationContext.xml中<bean id="cartAction" class="com.ansibee.shop.web.action.CartAction" scope="prototype">
struts.xml中<action name="cart_*" class="com.ansibee.shop.web.action.CartAction" method="{1}">
正确配置代码:applicationContext.xml中<bean id="cartAction" class="com.ansibee.shop.web.action.CartAction" scope="prototype">
struts.xml中<action name="cart_*" class="cartAction" method="{1}">
spring与struts2整合出现错误HTTP Status 500 - Unable to instantiate Action的更多相关文章
- HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'customer_toAddPage' i
使用struts2时碰到这样的错误 HTTP Status 500 - Unable to instantiate Action, customerAction, defined for 'custo ...
- 报错HTTP Status 500 - Unable to instantiate Action
报错如下: HTTP Status 500 - Unable to instantiate Action, visitAction, defined for 'visit_toAddPage' in ...
- jsp调用javabean出现错误HTTP Status 500 - Unable to compile class for JSP
HTTP Status 500 - Unable to compile class for JSP: type Exception report message Unable to compile ...
- hbase搭建web项目 报500错误 HTTP Status 500 - Unable to compile class for JSP
在昨天,用hbase做后台搭建web项目时,前边的进行的非常顺利,当运行时便 报错了,截图如下: 这是直接在jsp中接收参数报的错误,如果在servlet中,同样也是报500的错误,虽然显示的不太一样 ...
- struts2整合spring出现的Unable to instantiate Action异常
在struts2整合spring的时候,完全一步步按照官方文档上去做的,最后发现出现 Unable to instantiate Action,网上一搜发现很多人和我一样的问题,配置什么都没有错误,就 ...
- Spring与Struts2整合VS Spring与Spring MVC整合
Spring与Struts2整合,struts.xml在src目录下 1.在web.xml配置监听器 web.xml <!-- 配置Spring的用于初始化ApplicationContext的 ...
- SSH整合:Unable to instantiate Action, employeeAction, defined for 'emp-list' in namespace '/'employeeAction - action
SSH整合,照着视频敲的,不知为何会报错,经历了快两周的折磨给解决了.记录下来给后面需要帮助的人,也算极好的了. Struts Problem Report Struts has detected a ...
- SSH整合报错:Unable to instantiate Action, testAction, defined for 'test' in namespace '/'testAction
报错如下: Struts Problem Report Struts has detected an unhandled exception: Messages: testAction Unable ...
- 解决 HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException:
HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException: The foll ...
随机推荐
- nginx实战(1):宝塔设置反向代理
以下操作适用于默认80端口转其他地址非80端口情况. 添加网站 注意:因我只是拿来当反向代理来使用,所PHP为纯静态模式. 开启反向代理 注:目标URL为最终目的地,发送域名为默认,如设置后无效则修改 ...
- openstack (共享组件) 时间同步服务
云计算openstack共享组件——时间同步服务ntp(2) 一.标准时间讲解 地球分为东西十二个区域,共计 24 个时区 格林威治作为全球标准时间即 (GMT 时间 ),东时区以格林威治时区进行 ...
- java 常用类-String-1
一.字符串相关的类 1.1 String 的特性 String类:代表字符串.Java 程序中的所有字符串字面值(如 "abc" )都作为此类的实例实现. String是一个fin ...
- jpeg软解码实现介绍
我的月经贴博客该更新了!!!已经有许多博文需要补了! 去年开始的jpeg解码项目,中间停止更新了大半年时间,上个月想起这事还没完工,就又做了更多兼容性和性能上的改进,目前终于接近尾声了.有需要参考的可 ...
- 运行时数据区--程序计数器(PC Register)
程序计数器(PC Register) 这里的计数器(Program Counter Register)并非为广义上所指的物理寄存器,JVM中的PC寄存器(程序计数器)是对物理PC寄存器的一种抽象模拟, ...
- 转载:python的format格式化输出
https://www.cnblogs.com/chunlaipiupiupiu/p/7978669.html python中format函数 ---恢复内容开始--- python中format ...
- 深入了解Redis(6)-持久化原理
Redis是一个内存数据库,数据保存在内存中.但我们都知道存储在内存中的数据会因为外部因素而丢失,所以Redis会把数据持久化到磁盘中,至于是如何持久化呢? 一.RDB 1.手动触发 save:该命令 ...
- Java 实现常见内排序
一.内排序 1.排序基本概念 (1)什么是排序? 排序指将一个数据元素集合或者序列 按照某种规则 重新排列成一个 有序的集合或者序列.分为内排序.外排序.排序算法的好坏直接影响程序的执行速度以及存储空 ...
- Webpack + VueJS 学习、跳坑和总结
这篇随笔会陆续地更新下去,用于汇集一些关于Webpack的初学跳坑总结还有VueJS的基础知识. Webpack部分 ① 快速建立一个Webpack-Vue项目开发环境(4.39.1-2019/08/ ...
- Python 为什么不支持 switch 语句?
本文出自"Python为什么"系列,请查看全部文章 在这篇文章里,我们会聊一聊为什么 Python 决定不支持 switch 语句. 为什么想要聊这个话题呢? 主要是因为 swit ...