Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring initbinder注册多个自定义编辑器String.class_Spring_Spring Boot_Spring Mvc Initbinders - Fatal编程技术网

Spring initbinder注册多个自定义编辑器String.class

Spring initbinder注册多个自定义编辑器String.class,spring,spring-boot,spring-mvc-initbinders,Spring,Spring Boot,Spring Mvc Initbinders,我的ControllerAdvice课程中有以下内容 @InitBinder public void initBinder(WebDataBinder binder) { binder.registerCustomEditor(String.class, new StringTrimmerEditor(true)); binder.registerCustomEditor(String.class, new HtmlEscapeStringEditor(

我的ControllerAdvice课程中有以下内容

 @InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
        binder.registerCustomEditor(String.class, new HtmlEscapeStringEditor());
    }
当我将HtmlEscapeStringEditor添加到init活页夹时,字符串修剪器停止工作。有没有办法在一个类上注册多个自定义编辑器


感谢您的回答

也许这不是最优雅的解决方案,但它对我很有效。我创建了一个新类,它结合了HtmlEscapeStringEditor和StringTrimmerEditor的功能