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 ...
随机推荐
- Spock测试套件入门
目录 Spock测试套件 核心概念 整体认识 前置.后置 同junit的类比 Feature 方法 blocks 典型的用法 异常condition then和expect的区别 cleanup bl ...
- linux学习(五)Linux 文件与目录管理
一.Linux处理目录的常用命令 ls : 列出目录 cd :切换目录 pwd :显示目前的目录 mkdir :创建一个新的目录 rmdir :删除一个空的目录 cp : 复制文件或目录 rm : 移 ...
- [Abp vNext 源码分析] - 21. 界面与文字的本地化
一.简介 ABP vNext 提供了全套的本地化字符串支持,具体用法可以参考官方使用文档.vNext 本身是对 Microsoft 提供的本地化组件进行了实现,通过 JSON 文件提供本地化源,这一点 ...
- 利用 esp8266 搭建简单物联网项目
接上一篇博客,这次还是关于 esp8266 --> 物联网 一.云端数据监控:DHT11 + NodeMcu +Dweet.io 接上一篇博客的接线及相关配置不变( DHT11 + NodeMc ...
- Centos-移动文件或目录-mv
mv 移动文件或者目录,可以用重命名文件或者目录 相关选项 -i 如果文件或目录存在询问是否覆盖,输入y确认,输入n取消 -f 不提示,覆盖
- Python-临时文件文件模块-tempfile
案例: 某项目中,从传感器中获得采集数据,每收集到1G的数据后做是数据分析,最终只保留数据分析的结果,收集到的数据放在内存中,将会消耗大量内存,我们希望把这些数据放到一个临时的文件中 临时文件不能命名 ...
- Harmony OS 开发避坑指南——DevEco Device Tool 安装配置
Harmony OS 开发指南--DevEco Device Tool 安装配置 本文介绍如何在Windows主机上安装DevEco Device Tool工具. 坑点总结: 国内部分网络环境下,安装 ...
- 山寨一个Spring的@Component注解
1. 前言 我们在上一篇对Mybatis如何将Mapper接口注入Spring IoC进行了分析,有同学问胖哥这个有什么用,这个作用其实挺大的,比如让你实现一个类似@Controller的注解(或者继 ...
- 如何使用 dotTrace 来诊断 netcore 应用的性能问题
最近在为 Newbe.Claptrap 做性能升级,因此将过程中使用到的 dotTrace 软件的基础用法介绍给各位开发者. Newbe.Claptrap 是一个用于轻松应对并发问题的分布式开发框架. ...
- PHP添加新扩展包的步骤
1.找到PHP解压包,将 php.ini-development 这个文件复制一份,并修改后缀名为 .ini 2.将这个文件打开,将此处注释解开, 3.配置你扩展的该包的位置 4.如果显示不 ...