com.interface21.web.bind
Class BindUtils

java.lang.Object
  |
  +--com.interface21.web.bind.BindUtils

public abstract class BindUtils
extends java.lang.Object

Offers convenience methods for binding servlet request parameters to objects, including optional validation.

Since:
10.03.2003
Author:
Juergen Hoeller

Constructor Summary
BindUtils()
           
 
Method Summary
static BindException bind(javax.servlet.ServletRequest request, java.lang.Object object, java.lang.String objectName)
          Bind the parameters from the given request to the given object.
static BindException bindAndValidate(javax.servlet.ServletRequest request, java.lang.Object object, java.lang.String objectName, Validator validator)
          Bind the parameters from the given request to the given object, invoking the given validator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BindUtils

public BindUtils()
Method Detail

bind

public static BindException bind(javax.servlet.ServletRequest request,
                                 java.lang.Object object,
                                 java.lang.String objectName)
Bind the parameters from the given request to the given object.
Parameters:
request - request containing the parameters
object - object to bind the parameters to
objectName - name of the bind object
Returns:
the binder used (can be treated as DataBinder or Errors instance)

bindAndValidate

public static BindException bindAndValidate(javax.servlet.ServletRequest request,
                                            java.lang.Object object,
                                            java.lang.String objectName,
                                            Validator validator)
Bind the parameters from the given request to the given object, invoking the given validator.
Parameters:
request - request containing the parameters
object - object to bind the parameters to
objectName - name of the bind object
validator - validator to be invoked, or null if no validation
Returns:
the binder used (can be treated as Errors instance)


Rod Johnson and Spring contributors 2001-2003.