org.springframework.web.bind
Interface BindInitializer
- public interface BindInitializer
Callback that allows for initialization of a binder with
custom editors before the binding. Used by BindUtils.
- Author:
- Jean-Pierre PAWLAK
- Since: 08.05.2003
- See Also: BindUtils.bind(ServletRequest,java.lang.Object,java.lang.String,org.springframework.web.bind.BindInitializer), BindUtils.bindAndValidate(ServletRequest,java.lang.Object,java.lang.String,org.springframework.validation.Validator,org.springframework.web.bind.BindInitializer)
initBinder
public void initBinder(ServletRequest request, ServletRequestDataBinder binder)
throws ServletException
- Initialize the given binder instance, e.g. with custom editors.
Called by BindUtils#bind. This method allows you to register custom
editors for certain fields of your command class. For instance, you will
be able to transform Date objects into a String pattern and back, in order
to allow your JavaBeans to have Date properties and still be able to
set and display them in for instance an HTML interface.
- Parameters:
- request - current request
- binder - new binder instance
- Throws:
- ServletException - in case of invalid state or arguments
- See Also:
- org.springframework.validation.DataBinder.registerCustomEditor(java.lang.Class,java.beans.PropertyEditor), BindUtils.bind(ServletRequest,java.lang.Object,java.lang.String,org.springframework.web.bind.BindInitializer)