有关属性编辑器(customEditor)的问题未被应用?

时间:2010-12-27 07:30:53

标签: java spring-mvc

我正在使用Spring mvc 3,我想格式化一个字段。 根据建议,我想将其移至属性编辑器。

但似乎没有应用。 我做了:

@InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(String.class, "mobileNumber", new MobileNumberEditor(false));
    }

其中mobileNumber是我的User对象的变量。 我也尝试过user.mobileNumber,但这似乎不起作用?

我可能会注册(User.class,新的UserEditor(false)),但这似乎有点迂回。

0 个答案:

没有答案
相关问题