There is no Action mapped......

今天使用struts2 annotation,写了相关jsp文件和继承了ActionSupport的Action类,请求路径都是对的,但总是报错:

There is no Action mapped......

后来网上查了下,原来是Action类除了要继承Action或者名字是XxxAction之外,所在的包也要是struts/struts2/action/actions中的其中一个,不然会扫描不到自己的Action类;

apache给出了说明:http://struts.apache.org/docs/convention-plugin.html#ConventionPlugin-Codebehindhelloworld

These packages are located by the Convention plugin using a search methodology. First the Convention plugin finds packages named strutsstruts2action or actions. Any packages that match those names are considered the root packages for the Convention plugin. Next, the plugin looks at all of the classes in those packages as well as sub-packages and determines if the classes implement com.opensymphony.xwork2.Action or if their name ends with Action (i.e. FooAction)。

转载于:https://my.oschina.net/u/2430057/blog/538316

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值