From f3b09464f3096e935b4849656f6e9b712c9cb928 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Fri, 8 Apr 2016 16:47:11 +0200 Subject: [PATCH] Polish reference documentation `@InitBinder` annotated methods are not meant to be part of the public contract of Controller and should be package protected. --- src/asciidoc/web-mvc.adoc | 4 ++-- src/asciidoc/web-portlet.adoc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/asciidoc/web-mvc.adoc b/src/asciidoc/web-mvc.adoc index 95e471bc73..7ac6035da6 100644 --- a/src/asciidoc/web-mvc.adoc +++ b/src/asciidoc/web-mvc.adoc @@ -2039,7 +2039,7 @@ The following example demonstrates the use of `@InitBinder` to configure a public class MyFormController { **@InitBinder** - public void initBinder(WebDataBinder binder) { + protected void initBinder(WebDataBinder binder) { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false)); @@ -2062,7 +2062,7 @@ controller-specific tweaking of the binding rules. public class MyFormController { **@InitBinder** - public void initBinder(WebDataBinder binder) { + protected void initBinder(WebDataBinder binder) { binder.addCustomFormatter(new DateFormatter("yyyy-MM-dd")); } diff --git a/src/asciidoc/web-portlet.adoc b/src/asciidoc/web-portlet.adoc index 91d7560857..9f0e95c9ad 100644 --- a/src/asciidoc/web-portlet.adoc +++ b/src/asciidoc/web-portlet.adoc @@ -1462,8 +1462,8 @@ The following example demonstrates the use of `@InitBinder` for configuring a public class MyFormController { @InitBinder - public void initBinder(WebDataBinder binder) { - SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + protected void initBinder(WebDataBinder binder) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); dateFormat.setLenient(false); binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false)); }