1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html 变量类型强制转换 html js前台数据传到后台 spring复杂类型转换

html 变量类型强制转换 html js前台数据传到后台 spring复杂类型转换

时间:2020-10-17 16:25:44

相关推荐

html 变量类型强制转换 html js前台数据传到后台 spring复杂类型转换

html、js前台数据传到后台,spring复杂类型转换

如果我有两个变量,变量名不一样,处理的规则也不一样,但是他们都是Date.class 类型, 这可怎么破。比如:

@InitBinder

publicvoidbindingPreparation(WebDataBinderbinder){

DateFormatdateFormat1=newSimpleDateFormat("d-MM-yyyy");

CustomDateEditororderDateEditor=newCustomDateEditor(dateFormat1,true);

DateFormatdateFormat2=newSimpleDateFormat("MMMd,YYYY");

CustomDateEditorshipDateEditor=newCustomDateEditor(dateFormat2,true);

binder.registerCustomEditor(Date.class,"orderDate",orderDateEditor);

binder.registerCustomEditor(Date.class,"shipDate",shipDateEditor);

}

spring中有很多种propertyEditor

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。