标签:ota str util datetime mat bean utils ble 转换
atitit.提升开发效率---MDA 软件开发方式的革命(4)----编辑表单建模
2. 指定显示模板 @BeanEditForm(tmplt="c:/edit.html") 1
3. 配置属性的@Property(lable=”xxx”)显示 2
4. 配置属性的显示控件方式@DataType(value=DataTypeConstants.select,datasource="c:/cate.htm") 2
6. 属性排序@BeanEditForm( reorder="aa,bb") 2
7. client验证 @Validate("required")@Validate("min=18,max=99,msg=’又一次输入’") 2
8. 数据转换@com.attilax.anno.Converter(TimeConverterO7.class) 3
由于仅仅十个数据建模,马包含流程建模
作者:: 老哇的爪子 Attilax 艾龙。 EMAIL:1466519819@qq.com
转载请注明来源: http://blog.csdn.net/attilax
public class GvMaterial
DataTypeConstants.time
DataTypeConstants.datetime
DataTypeConstants.file
DataTypeConstants.select
@DataType(value=DataTypeConstants.select,datasource="c:/cate.htm")
Validator |
Constraint Type |
Description |
Example |
|
– |
Ensures that the given input looks like a valid e-mail address |
<t:textfield value="email" validate="email" /> |
max |
long |
Enforces a maximum integer value |
<t:textfield value="age" validate="max=120,min=0" /> |
maxLength |
int |
Makes sure that a string value has a maximum length |
<t:textfield value="zip" validate="maxlength=7" /> |
min |
long |
Enforces a minimum integer value |
<t:textfield value="age" validate="max=120,min=0" /> |
minLength |
int |
Makes sure that a string value has a minimum length |
<t:textfield value="somefield" validate="minlength=1" /> |
none |
– |
Does nothing (used to override a @Validate annotation) |
<t:textfield value="somefield" validate="none" /> |
regexp |
pattern |
Makes sure that a string value conforms to a given pattern |
<t:textfield value="letterfield" validate="regexp=^[A-Za-z]+$" /> |
required |
– |
Makes sure that a string value is not null and not the empty string |
<t:textfield value="name" validate="required" /> |
class TimeConverterO7 implements org.apache.commons.beanutils.Converter
public Object convert(Class arg0, Object arg1) {
// attilax 老哇的爪子 5:24:02 AM Jul 19, 2014
try {
return DateUtil.toTimeStamp(arg1, true);
} catch (ParseException e) {
// attilax 老哇的爪子 5:28:07 AM Jul 19, 2014
core.log(e);
return 0;
}
}
Forms and Validation -- Apache Tapestry.htm
atitit.提升开发效率---MDA 软件开发方式的革命(4)----编辑表单建模
标签:ota str util datetime mat bean utils ble 转换
原文地址:http://www.cnblogs.com/wzjhoutai/p/6992466.html