Spring Framework

Spring Projects

Spring Project 1

adplus-dvertising
MultiActionController in Spring MVC
Previous Home Next

This controller provide the facility to controlled the multiple request handle by the same class. Subclass of this class handle different type of request through the following method:

ModelAndView actionName(HttpServletRequest request,
 HttpServletResponse response); 

In the above method we are take the third parameter which name is HttpSession this parameter provide the facility to command the request processing.

Syntax:

 public class MultiActionController
extends AbstractController
implements lastModified

This controller provide the following type of constructor:

  1. public MultiActionController() throws ApplicationContextException
  2. public MultiActionController(Object delegate) throws ApplicationContextException

This controller provide the following type of method:

setMethodNameResolver:

public final void setMethodNameResolver
(MethodNameResolver methodNameResolver);

getMethodNameResolver:

public final MethodNameResolver getMethodNameResolver();

setValidators:

public final void setValidator(Validator[] validators);

getValidators:

public final Validator[] getValidators();

setDelegate:

public final void setDelegate(Object delegate);

getLastModified:

public long getLastModified(HttpServletRequest request);

handleRequestInternal:

protected ModelAndView handleRequestInternal
(HttpServletRequest requ,HttpServletResponse respon)
throws Exception

handleNoSuchRequestHandlingMethod:

protected ModelAndView handleNoSuchRequestHandlingMethod
(NoSuchRequestHandlingMethodException ex,HttpServletRequest
request,HttpServletResponse response) throws Exception

invokeNameMethod:

protected final ModelAndView invokeNameMethod(String methodName,
HttpServletRequest request,HttpServletResponse response) throws
Exception

newCommandObject:

protected Object newCommandObject(Class clazz)throws Exception

bind:

protected void bind(ServletRequest request,Object command)
throws Exception

createBinder:

protected ServletRequestDataBind createBinder(ServletRequest
request, Object command)throws Exception

getCommandName:

protected String getCommandName(Object command);

initBinder:

protected void initBinder(ServletRequest request,
ServletRequestDataBinder binder) throws Exception

getExceptionHandler:

protected Method getExceptionHandler(Throwable ex);

Example of MultiActionController in Spring MVC

Previous Home Next