Spring Framework

Spring Projects

Spring Project 1

adplus-dvertising
Controller Interface in Spring MVC
Previous Home Next

Spring MVC provide the Controller interface, this controller is the top controller of spring MVC controller hierarchy this controller interface representing the component that receives HttpServletRequest and HttpServletResponse like httpServlet. This controller help the work flow of spring MVC.

Syntax:

 public interface Controller

The Controller interface provide the following method which are:

handlerRequest(): This method provide the facility to receive the request which are send by the user and process by DispatcherServlet. After that this request received by the HttpServletRequest and return the ModelAndView object.

Syntax:

ModelAndView handlerRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception;

Parameter:

request->Http request.

response->Http respone.

Returns:

ModelAndView Object

Null

Throws:

Exception

Example of Controller Interface in Spring MVC

Previous Home Next