关于spring-mvc的InitBinder注解的参数
来源:互联网 发布:2015网络大电影排行榜 编辑:程序博客网 时间:2024/06/12 00:09
通过Spring-mvc的@InitBinder注释的方法可以对WebDataBinder做一些初始化操作。
比如设置Validator。
我一直在想能不能为每个Request或者每个Action方法单独设置Validator。
也就是说Controller里有多个被@InitBinder标注的方法。 在不同的Action时被分别调用。
我注意到了@InitBinder的value参数,
api docs里是这样描述的:
The names of command/form attributes and/or request parameters that this init-binder method is supposed to apply to.
比如设置Validator。
我一直在想能不能为每个Request或者每个Action方法单独设置Validator。
也就是说Controller里有多个被@InitBinder标注的方法。 在不同的Action时被分别调用。
我注意到了@InitBinder的value参数,
api docs里是这样描述的:
The names of command/form attributes and/or request parameters that this init-binder method is supposed to apply to.
Default is to apply to all command/form attributes and all request parameters processed by the annotated handler class. Specifying model attribute names or request parameter names here restricts the init-binder method to those specific attributes/parameters, with different init-binder methods typically applying to different groups of attributes or parameters.
是乎是可以针对不同的Form对象或命令调用不同的InitBinder方法。
于是我写了下面的Controller试了一下
- 关于spring-mvc的InitBinder注解的参数
- 关于spring-mvc的InitBinder注解的参数
- spring mvc InitBinder 遇到的坑接收不了参数
- 关于Spring MVC注解 @Transactional 事务标签 @InitBinder 标签
- 关于Spring MVC注解 @Transactional 事务标签 @InitBinder 标签
- @InitBinder注解的使用
- springMVC里面的注解@InitBinder
- 关于spring mvc Controller的几个注解
- 关于spring mvc Controller的几个注解
- spring MVC的注解
- Spring MVC的注解@
- spring mvc @InitBinder
- spring mvc @InitBinder
- 学习Spring MVC,关于注解的Spring MVC,关于控制器的Spring MVC,学习Spring,简单Spring MVC实例
- Spring中@initBinder的使用
- 关于Spring MVC的参数绑定
- Spring MVC的一些关于请求的注解用法详解
- Spring MVC 集成 AOP,自定义注解,在切面获得方法参数,以及自定义注解的参数。
- 求数组中和最大的子数组
- Some Tips for CSQA exam
- page-break-after多打印一页问题的解决
- JVM垃圾回收机制
- 输出字符串中的中文字符
- 关于spring-mvc的InitBinder注解的参数
- AsyncTask使用实例---加载网络图片
- C++/MFC/GDI+(七)——获取Graphics中的图像数据
- DirectShow VS2008开发环境搭建
- linux内核中container_of详解
- Asyle在source Insight 中的使用
- 30段超实用CSS代码
- 虚拟机 matlab
- log4cplus内存泄漏起因之一 结构体字节对齐 log4cplus结构体使用的是8字节对齐