美文网首页
那些年踩过的坑(4)Struts2 中action路径通配符问题

那些年踩过的坑(4)Struts2 中action路径通配符问题

作者: Ethan_Walker | 来源:发表于2017-08-21 17:00 被阅读9次

为了匹配 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]

没找到什么原因,遇到这种奇葩的问题真是头疼

相关文章

网友评论

      本文标题:那些年踩过的坑(4)Struts2 中action路径通配符问题

      本文链接:https://www.haomeiwen.com/subject/ischdxtx.html