这个拦截器的目的是将一个参数名映射为另一个参数名.它可以作为在不同action之间共享不同名字的相同参数的粘合剂,这一点对于实现action链很有用.
Action的别名表达式应该是这样的形式:
#{ "name1" : "alias1", "name2" : "alias2" } . 这个意思是说,如果一个action(或者stack中的其他东西)有一个叫
name1的属性,这个action应用了这个拦截器,且有
alias1的setter方法,
name1的值会被设置到
alias1上.
参数
- aliasesKey (可选的) - action中的别名Map的名字 (默认为aliases).
扩展这个拦截器
这个拦截器没有可扩展的地方.
例子
<action name="someAction" class="com.examples.SomeAction">
<\!-\- The value for the foo parameter will be applied as if it were named bar \-->
<param name="aliases">#{ 'foo' : 'bar' } </param>
<\!-\- note: the alias interceptor is included with the defaultStack in webwork-default.xml \-->
<interceptor-ref name="alias"/>
<interceptor-ref name="basicStack"/>
<result name="success">good_result.ftl</result>
</action>