【发布时间】:2011-02-04 23:20:42
【问题描述】:
我正在尝试将这两个 url 路由到不同的操作。我们正在使用 Struts 1.2:
/abc-def/产品
/abc-def
我试着把这个动作放在第一位:
<action path="/abc*/products" type="com.business.exampleAction">
<forward name="success" path="/go"/>
</action>
然后是这个:
<action path="/abc*" type="com.business.differentExampleAction">
<forward name="success" path="/goElsewhere"/>
</action>
但它总是转到第二个操作(在这种情况下为 differentExampleAction)。 我已经为 * 尝试了各种迭代,例如 .* 或 (.*),但还没有找到任何真正有效的方法。
根据我的阅读,似乎 struts-config 中唯一允许的类似正则表达式的字符是通配符(* 和 **),但我希望我错了。
【问题讨论】:
标签: java struts struts-config