在struts2中,是否可以使用带变量的可选patternMapping?

时间:2014-04-02 05:32:54

标签: java struts2

常数

<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
<constant name="struts.patternMatcher" value="regex" />

当前版本

<action name="list/{pageNo}" method="list" class="xx.GroupAction">
    <result type="dispatcher">/WEB-INF/jsp/sys/group/list.jsp</result>
</action>
<action name="list">
    <result type="redirectAction">list/</result>
</action>

这就是我想要的

<action name="list(/{pageNo})?" method="list" class="xx.GroupAction">
    <result type="dispatcher">/WEB-INF/jsp/sys/group/list.jsp</result>
</action>

wildcard-mappings

引入

有可能实现我想要的目标吗?

1 个答案:

答案 0 :(得分:0)

没有

您提供的文档链接说明了可用的选项。可选的匹配和括号不是通配符映射的功能。