在进行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的更多相关文章

  1. 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 ...

  2. 报错HTTP Status 500 - Unable to instantiate Action

    报错如下: HTTP Status 500 - Unable to instantiate Action, visitAction, defined for 'visit_toAddPage' in ...

  3. 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 ...

  4. hbase搭建web项目 报500错误 HTTP Status 500 - Unable to compile class for JSP

    在昨天,用hbase做后台搭建web项目时,前边的进行的非常顺利,当运行时便 报错了,截图如下: 这是直接在jsp中接收参数报的错误,如果在servlet中,同样也是报500的错误,虽然显示的不太一样 ...

  5. struts2整合spring出现的Unable to instantiate Action异常

    在struts2整合spring的时候,完全一步步按照官方文档上去做的,最后发现出现 Unable to instantiate Action,网上一搜发现很多人和我一样的问题,配置什么都没有错误,就 ...

  6. Spring与Struts2整合VS Spring与Spring MVC整合

    Spring与Struts2整合,struts.xml在src目录下 1.在web.xml配置监听器 web.xml <!-- 配置Spring的用于初始化ApplicationContext的 ...

  7. SSH整合:Unable to instantiate Action, employeeAction, defined for 'emp-list' in namespace '/'employeeAction - action

    SSH整合,照着视频敲的,不知为何会报错,经历了快两周的折磨给解决了.记录下来给后面需要帮助的人,也算极好的了. Struts Problem Report Struts has detected a ...

  8. SSH整合报错:Unable to instantiate Action, testAction, defined for 'test' in namespace '/'testAction

    报错如下: Struts Problem Report Struts has detected an unhandled exception: Messages: testAction Unable ...

  9. 解决 HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException:

    HTTP Status 500 - Unable to show problem report: freemarker.core.InvalidReferenceException: The foll ...

随机推荐

  1. Spring Boot 所有相关的配置信息

    加载顺序 如上图所示,图片是从官网上截取的,这些配置信息都会加载,只不过顺序在前的会覆盖掉后面的 上图的所有配置信息都会以(key,value)的形式加载到Spring中的Environment中,也 ...

  2. 部署cobbler服务器

    部署cobbler服务器 1.准备环境使用nat或者仅主机模式,不要使用桥接模式,方式获取的IP不是自己的 2. 配置yum源[epel]name=epelenabled=1gpgcheck=0bas ...

  3. 永久激活(idea,pycharm等推荐使用)

    二.永久激活(推荐使用)激活码激活总是过期,永久激活后,一劳永逸,不需要每次都在网上搜索激活码了. 1.下载激活插件:jetbrains-agent.jar(关注公号[吾非同]回复pycharm获取) ...

  4. kafka学习(五)Spring Boot 整合 Kafka

    文章更新时间:2020/06/08 一.创建Spring boot 工程 创建过程不再描述,创建后的工程结构如下: POM文件中要加入几个依赖: <?xml version="1.0& ...

  5. 2020 Java开发者数据分析:中国已成为 Java 第一大国

    最近知名开发工具供应商Jetbrains在Java 25周年之际,对开发群体做了一次有意思的数据分析. 全文内容可见:https://blog.jetbrains.com/idea/2020/09/a ...

  6. js自定义属性的操作

    <body> <div id = "demo" index = "1" class = "nav"></div ...

  7. 081 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 06 new关键字

    081 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 06 new关键字 本文知识点:new关键字 说明:因为时间紧张,本人写博客过程中只是 ...

  8. Python3基础——递归

    递归函数 如果一个函数在内部调用自身本身,这个函数就是递归函数. 递归函数的优点是定义简单,逻辑清晰.理论上,所有的递归函数都可以写成循环的方式,但循环的逻辑不如递归清晰. 使用递归函数需要注意防止栈 ...

  9. Matlab 中 imshow 函数

    转自: https://blog.csdn.net/xiaochou87/article/details/43488829 matlab中显示图像的语句是:                       ...

  10. 几个常用markdown工具的主要优缺点

    几个常用markdown工具的主要优缺点 最近对几个热门的markdown工具做了一个对比表 表格 脚注 图片和图床 平台 移动端 实时预览 收费 操作难度 导出功能 mweb 非常棒 预览正常显示 ...