com.mortbay.Servlets
Interface ServletDispatchErrorHandler
- public interface ServletDispatchErrorHandler
Handle an Argument Format Error
Object that are being called by ServletDispatch.dispatch calls may
implement this interface if they take arbitrary object as parameters and
expect ServletDispatch to populate those objects from request
parameters. If there are errors converting the parameters into the correct
types of the argument object, then the ServletDispatch object will call
the argumentFormatError() function on the target object if it implements
this interface, passing in the names of the field that did not convert
correctly.
Notes
This call has nothing to do with whether the request parameters were
present or not, simply with whether those present could be parsed. If the
user wishes to check whether request parameters are present, it is
suggested they initialise their Argument object values with default values
that will be recognised as not having been overridden (such as null, or
unlikely values for number types, e.g. - MAX_INT).
- Version:
- 1.0 Sun Jun 11 2000
- Author:
- Matthew Watson (mattw)
- See Also:
ServletDispatch
Method Summary |
java.lang.Object |
argumentFormatError(java.lang.String method,
ServletDispatch dispatch,
java.lang.Object context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String[] fields)
Handle an Argument Format Error |
argumentFormatError
public java.lang.Object argumentFormatError(java.lang.String method,
ServletDispatch dispatch,
java.lang.Object context,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res,
java.lang.String[] fields)
- Handle an Argument Format Error
- Parameters:
method
- The name of the method being called.dispatch
- The dispatch objectcontext
- The user contextreq
- res
- fields
- An array of the names of the fields that had format errors- Returns:
- non-null if the request was handled