在进行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. mariadb 数据库集群配置

    mariadb集群配置(主从和多主)   mariadb主从 主从多用于网站架构,因为主从的同步机制是异步的,数据的同步有一定延迟,也就是说有可能会造成数据的丢失,但是性能比较好,因此网站大多数用的是 ...

  2. matlab中矩阵的表示与简单操作

    原文地址为:matlab矩阵的表示和简单操作 一.矩阵的表示在MATLAB中创建矩阵有以下规则: a.矩阵元素必须在”[ ]”内: b.矩阵的同行元素之间用空格(或”,”)隔开: c.矩阵的行与行之间 ...

  3. Mybatis接口Mapper内的方法为啥不能重载吗?

    动态代理的功能:通过拦截器方法回调,对目标target方法进行增强. 言外之意就是为了增强目标target方法.上面这句话没错,但也不要认为它就是真理,殊不知,动态代理还有投鞭断流的霸权,连目标tar ...

  4. 【知识分享】Navicat Premium for Mac的破解教程

    转自Navicat Premium for Mac v12.0.22.0 破解教程,macOS上手动破解,无需补丁,无毒下载了Navicat,没有注册码,突然发现了这篇破解教程,竟爱不释手,顾Copy ...

  5. ThreadLocal 和神奇的数字 0x61c88647

    这篇文章会详细阐述ThreadLocal的内部结构及其原理,以及神奇的0x61c88647 在Java 1.4之前,ThreadLocals会产生线程间的竞争,无法写出高性能的代码. Java 1.5 ...

  6. Java审计之命令执行篇

    Java审计之命令执行篇 0x00 前言 在Java中能执行命令的类其实并不多,不像php那样各种的命令执行函数.在Java中目前所知的能执行命令的类也就两种,分别是Runtime和 ProcessB ...

  7. HTML+CSS实现大盒子在小盒子的展示范围内进行滚动展示

    HTML+CSS实现大盒子在小盒子的展示范围内进行滚动展示 1.效果展示: 2.主要代码:样式: overflow:auto; 3.如果想要消除对应的滚动条: .out::-webkit-scroll ...

  8. android.support.v7.app.AppCompatActivity不能使用的解决办法

    最近Android Studio 更新到4.0版本后,在构建项目时使用 android.support.v7.XX android.support.v4.XX 发现在xml文件中,原先我最常使用的Dr ...

  9. 条件编译(debug)

    1. #ifdef 标识符 代码段1 #else 代码段2(可以为空) #endif (条件编译结束语句,和#ifdef配套使用) 如果标识符被#define过,则编译代码段1,否则编译代码段2 2. ...

  10. 运行时数据区--程序计数器(PC Register)

    程序计数器(PC Register) 这里的计数器(Program Counter Register)并非为广义上所指的物理寄存器,JVM中的PC寄存器(程序计数器)是对物理PC寄存器的一种抽象模拟, ...