看了一些Gravel项目的tld,记录一下自己的理解。
[size=large][b]ga:parameter[/b][/size]
Create an action listener that reads a value from the request pararmeter map. The value will be stored in the target. If the parameter occurs more than once, the target will be updated once for each value. You may optinally register a converter to translate the parameter data before it is stored into the target.
从request参数map中获取参数值并保存到目标中去。如果参数出现多次,每次都会用新值替换原来的值。可以注册一个转换器将参数值转换成你希望是数据类型再保存到目标中。
[list]
[*]name:request pararmeter map中的key,参数名
[*]target:目标变量名
[*]default:默认值,若request pararmeter map中没有相应的key,用默认值对变量赋值
[/list]
[size=large][b]ga:parameter[/b][/size]
<ga:parameter name="view" target="#{viewMode}" default="task"/>
<ga:parameter name="name" target="#{task_filter_name}" default="">
<f:converter converterId="gravel.StringWildcardFilter"/>
</ga:parameter>
Create an action listener that reads a value from the request pararmeter map. The value will be stored in the target. If the parameter occurs more than once, the target will be updated once for each value. You may optinally register a converter to translate the parameter data before it is stored into the target.
从request参数map中获取参数值并保存到目标中去。如果参数出现多次,每次都会用新值替换原来的值。可以注册一个转换器将参数值转换成你希望是数据类型再保存到目标中。
[list]
[*]name:request pararmeter map中的key,参数名
[*]target:目标变量名
[*]default:默认值,若request pararmeter map中没有相应的key,用默认值对变量赋值
[/list]
本文解析了Gravel项目中的tld配置文件,重点介绍了ga:parameter元素的使用方法及其属性,包括如何从请求参数中读取数据并转换类型。

136

被折叠的 条评论
为什么被折叠?



