使用spring和struts2集成全注解时 struts2默认扫描包名 action,actions,struts,struts2 的包 如果action不存在以上包时 就不会扫描到
此时需要在struts.xml中增加注释
<constant name="struts.convention.package.locators" value="action,actions,struts,struts2,admin"/>
admin为增加的包名
本文介绍如何在Struts2与Spring集成时使用全注解配置,并解决Struts2默认扫描不到action的问题。通过在struts.xml中添加特定配置,可以扩展默认扫描的包范围。
使用spring和struts2集成全注解时 struts2默认扫描包名 action,actions,struts,struts2 的包 如果action不存在以上包时 就不会扫描到
此时需要在struts.xml中增加注释
<constant name="struts.convention.package.locators" value="action,actions,struts,struts2,admin"/>
admin为增加的包名
转载于:https://www.cnblogs.com/mingf123/p/3853830.html

被折叠的 条评论
为什么被折叠?