struts2.0 Action 通配符的问题
struts2.0中的action是支持通配符映射的。但是它的返回值对应页面是否支持通配呢?
如下面这个action定义,其中result name同页面存放路径是对应的:
<action name="ask" class="com.test.web.action.AskAction">
<result name="010" type="freemarker">fm/010/Ask.html</result>
<result name="020" type="freemarker">fm/020/Ask.html</result>
<result name="030" type="freemarker">fm/030/Ask.html</result>
<result name="040" type="freemarker">fm/040/Ask.html</result>
<result name="050" type="freemarker">fm/050/Ask.html</result>
......
</action>
那么能否这样定义,来实现返回值的通配呢?
<action name="ask" class="com.test.web.action.AskAction">
<result name="*" type="freemarker">fm/{1}/Ask.html</result>
</action>