...
Panel | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wiki Markup | We need to look carefully at the "object" argument. The object here is a Command. LoginController extends SimpleFormController which extends AbstractFormController which extends BaseCommandController which extends AbstractController which extends WebContentGenerator which extends WebApplicationObjectSupport which extends ApplicationObjectSupport. In Spring Web MVC FormControllers, the forms play the role of "commands" in the more general CommandController model. So, in AbstractController there is a final method handleRequest(): {
As we can see here, it delegates to the method handleRequestInternal(), which is declared to be abstract: {
LoginController defaults this Command class: {
In BaseCommandController, we have: {
And the createCommand() method to which it delegates: {
|
Code Block | ||
---|---|---|
| ||
/** * Interface for a class that can bind items stored in the request to a particular * credentials implementation. This allows for binding beyond the basic * JavaBean/Request parameter binding that is handled by Spring automatically. */ public interface CredentialsBinder { /** * Method to allow manually binding attributes from the request object to properties of * the credentials. Useful when there is no mapping of attribute to property for the * usual Spring binding to handle. * * @param request The HttpServletRequest from which we wish to bind credentials to * @param credentials The credentials we will be doing custom binding to. */ void bind(HttpServletRequest request, Credentials credentials); /** * * Method to determine if a CredentialsBinder supports a specific class or not. * * @param clazz The class to determine is supported or not * @return true if this class is supported by the CredentialsBinder, false otherwise. */ boolean supports(Class clazz); } |