NEW
Font size
WorksheetsSpring MVC
Total questions: 10
Worksheet time: 15mins
Which of the following element defines the base-package where DispatcherServlet will search the controller class?
context:component-scan
mvc:annotation-driven
context:bean-scan
none of these
Which of the following is responsible for mapping the incoming request to the appropriate handler method in Spring MVC?
DispatcherServlet
HandlerMapping
ViewResolver
ModelAndView
What does DispatcherServlet consult in Spring MVC to map the logical view name to a specific view implementation?
Handler mapping
View resolver
Controller
View
The logic performed by a controller often produces some information that needs to be carried to the user/browser. This information in Spring MVC is known as _______________
Model
View
Controller
All of the above
Where does the incoming request first reach in a Spring MVC application?
Controller
Model Object
View
DispatcherServlet
What is the annotation used to map a method parameter to a URI template variable?
@PathVariable
@Path
@PathLocale
None of the mentioned
@RequestMapping annotation is used to map a HTTP request method (GET or POST) to a specific class or method in the controller which will handle the respective request.
True
False
What is the correct annotation to declare a controller in Spring MVC?
@Controller
@ConfigController
@SpringController
@AppController
Which of the following folder in spring mvc project contains web.xml?
META-INF
WEB-INF
src folder
Any of the above folders
Which of the following is correct about spring mvc?
A model contains the data of the application. A data can be a single object or a collection of objects.
A controller contains the business logic of an application. Here, the @Controller annotation is used to mark the class as the controller.
A view represents the provided information in a particular format. Generally, JSP is used to create a view page.
In Spring Web MVC, the DispatcherServlet class works as the front controller. It is responsible to manage the flow of the Spring MVC application.
All of the above
