为了匹配 book_add、book_delete、book_update,可通过通配符简化为如下所示
<package name="book" extends="struts-default" namespace="/">
<action name="book_*" class="com.example.demo3.action.BookAction" method="{1}"></action>
</package>
但是奇葩的事情出现了:
在 BookAction 配置的 add、delete、update方法只有 delete方法可以访问,默认的execute都可以访问,访问 book_add和 book_update 都报错
Struts has detected an unhandled exception:
Messages:
There is no Action mapped for namespace [/] and action name [book_update] associated with context path [].
Stacktraces
There is no Action mapped for namespace [/] and action name [book_update] associated with context path []. - [unknown location]
没找到什么原因,遇到这种奇葩的问题真是头疼