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 ...
随机推荐
- Docker:常见命令
Docker常见命令(持续更新中): 说明 命令 截图 1 查看Docker版本 Docker -v 2 查看镜像 Docker image ls 3 查看容器 Docker conta ...
- 虚拟机系列 | JVM运行时数据区
本文源码:GitHub·点这里 || GitEE·点这里 一.内存与线程 1.内存结构 内存是计算机的重要部件之一,它是外存与CPU进行沟通的桥梁,计算机中所有程序的运行都在内存中进行,内存性能的强弱 ...
- Python-维护排序好的序列模块-bisect
bisect模块 处理已经排序的序列,升序,从小到大,分插入数据和查看插入数据的位置两大核心,类似于插入排序算法 插入数据 # 首先这个序列按升序规则已经排序好的 # 查找规则是二分查找,当数据相等的 ...
- [论文理解] Good Semi-supervised Learning That Requires a Bad GAN
Good Semi-supervised Learning That Requires a Bad GAN 恢复博客更新,最近没那么忙了,记录一下学习. Intro 本文是一篇稍微偏理论的半监督学习的 ...
- CF538B Quasi Binary 思维题
题目描述 给出一个数 \(n\),你需要将 \(n\) 写成若干个数的和,其中每个数的十进制表示中仅包含\(0\)和\(1\). 问最少需要多少个数 输入输出格式 输入格式: 一行 一个数 \(n(1 ...
- 用 shell 脚本做 restful api 接口监控
问题的提出 基于历史原因,公司有一个"三无"采集服务--无人员.无运维.无监控--有能力做的部门不想接.接了的部门没能力.于是就一直这样裸奔,直到前几天一个依赖于这个采集服务的大数 ...
- 使用docker搭建redis服务器记录
#mkdir /home/redishome#mkdir /home/redishome/data#chmod -R 777 /home/redishome把redis.conf传到/home/red ...
- golang执行exec命令
创建对象: cmd, err := exec.Command("echo", "show me") 执行命令: cmd.Run() //Run 阻塞进程, ...
- 2440启动流程 <转载>
韦东山 博客园 首页 订阅 管理 2440启动过程分析 2440启动过程分析 2440启动过程算是一个难点,不太容易理解,而对于2440启动过程的理解,影响了后面裸机代码执行流程的分析,从而看出2 ...
- 17.JAVA-常用总结
for另一种写法 for(UserBean bean : list){ //for循环取出list中每个成员,并赋给bean变量 System.out.println(bean.getName()); ...