top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is a Controller in Spring MVC?

0 votes
403 views
What is a Controller in Spring MVC?
posted Aug 28, 2017 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Just like MVC design pattern, Controller is the class that takes care of all the client requests and send them to the configured resources to handle it. In Spring MVC, org.springframework.web.servlet.DispatcherServlet is the front controller class that initializes the context based on the spring beans configurations.

A Controller class is responsible to handle different kind of client requests based on the request mappings. We can create a controller class by using @Controller annotation. Usually it’s used with @RequestMapping annotation to define handler methods for specific URI mapping.

answer Aug 29, 2017 by Pooja Singh
...