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.

Since:
08.05.2003
Author:
Jean-Pierre PAWLAK
See Also:
BindUtils.bind(ServletRequest,Object,String,BindInitializer), BindUtils.bindAndValidate(ServletRequest,Object,String,org.springframework.validation.Validator,BindInitializer)

Method Summary
 void initBinder(ServletRequest request, ServletRequestDataBinder binder)
          Initialize the given binder instance, e.g. with custom editors.
 

Method Detail

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:
DataBinder.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor), BindUtils.bind(ServletRequest,Object,String,BindInitializer)


Copyright (C) 2003-2004 The Spring Framework Project.