Saturday, July 4, 2015

Spring MVC Interview Questions

Spring MVC Interview Questions
What is Spring MVC?
A framework to develop Web application in Java using Model View controller framework

What is Dispatcher Servlet in Spring MVC?
Its main class, acts as front controller and its registered in web.xml. Spring requires another configuration file known by its name.

What is advantage of Spring MVC over Struts 2.0?
Does Spring MVC Provides Validation support? How?
Yes, it does

What is ViewResolver class? How does they work?
ViewResolver class is responsible to implement View object pattern

Which design patterns are used in Spring MVC?
MVC (Model View Controller), Front Controller and ViewObject
Which class acts as Front Controller in Spring MVC? (Dispatcher Servlet)

What does @Controller annotation do?
It is used to mark a class as Controller in Spring MVC framework, its a class level annotation.

What does @RequestMapping annotation does?
Its another Spring MVC specific annoation which is used to map the request with the methods, its applied to method level.

What is ContextLoaderListener in Spring framework?
ContextLoaderLister is a listener which is responsible for starting and stopping Spring's root WebAplication context.

What is MultipartResolver? When do you use MultipartResolver?
MultipartResolver is used for uploading files into server

How do you handle Exception in Spring MVC Framework?

What are the minimum configuration required to create a Spring MVC application?

What is Spring MVC Interceptor and how to use it?

What is Spring Security?

How to control number of active session in Spring MVC?

How do you do LDAP authentication in Spring MVC framework?

Difference between constructor and setter injection in Spring?