开发者社区 问答 正文

struts2整合spring时,一直不能得到Action? 400 报错

struts2整合spring时,一直不能得到Action? 400 报错

@Component("action")配置在Action类上     在struts.xml是   <action name="action" class="com.web.Action.Action" method="add">     但是一直出错 

展开
收起
爱吃鱼的程序员 2020-05-30 21:03:57 604 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    整合方法错误,struts2 整合spring时,action组件上不需要这个注解,插件会根据包自动扫描并注册action的,action class 属性配置类名在spring里的bean name 即可 ,一般是首字母小写, 比如UserAction  bean name 是userAction

    2020-05-30 21:03:58
    赞同 展开评论