zoukankan      html  css  js  c++  java
  • spring与struts2整合出现错误HTTP Status 500

    在进行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}">

  • 相关阅读:
    关于自定义UICollectionViewLayout的一点个人理解<一>
    自定义进度条
    iOS 无限轮播图的两种实现
    图片的拉伸
    关于plist文件
    加载gif图过渡效果
    关于textView的字数限制
    php-fpm服务启动脚本
    转载:PHP支付宝接口RSA验证
    将博客搬至CSDN
  • 原文地址:https://www.cnblogs.com/ansibee/p/6947257.html
Copyright © 2011-2022 走看看