Wrong URL match in action

允我心安 提交于 2019-12-01 11:41:52

问题


<action name="/partner/*/*" class="webStoreAction">
    <param name="saveUrl">true</param>
    <param name="homeName">HomePartner</param>
    <param name="partner">{1}</param>
    <param name="partnerId">{2}</param>
    <param name="homeFromMenu">false</param>
    <result name="success" type="jsf">
        /WEB-INF/pages/load.xhtml
    </result>
</action>

Why localhost:8080/partner/partnerName matches with this action?


回答1:


Try <constant name="struts.patternMatcher" value="regex"/> the only viable matcher for the constants above. This is usually used with advanced wildcards mode, explained here.

The URL splitted into namespace / and action name partner/partnerName. The last matches a pattern compiled from the name in the action config using a wildcard mapper, which is a default mapper.



来源:https://stackoverflow.com/questions/26741967/wrong-url-match-in-action

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!