Interview Questions on Spring MVC

Some of questions on MVC will asked while interviewing candidates. These are as follows:

  1. What is Spring MVC framework?

  2. What is DispatcherServlet and ContextLoaderListener?

  3. What is the front controller class of Spring MVC?

  4. How to use Java based configuration?

  5. How can we use Spring to create Restful Web Service returning JSON response?

  6. Can we have multiple Spring configuration files?

  7. Difference between <context:annotation-config> vs <context:component-scan>?

  8. Difference between @Component, @Controller, @Repository & @Service annotations?

  9. What does the ViewResolver class?

  10. What is a MultipartResolver and when it’s used?

  11. How to upload file in Spring MVC Application?

  12. How does Spring MVC provide validation support?

  13. How to validate form data in Spring Web MVC Framework?

  14. What is Spring MVC Interceptor and how to use it?

  15. How to handle exceptions in Spring MVC Framework?

  16. How to achieve localization in Spring MVC applications?

  17. How to get ServletContext and ServletConfig object in a Spring Bean?

  18. How to use Tomcat JNDI DataSource in Spring Web Application?

  19. How would you relate Spring MVC Framework to 3-tier architecture?