wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Spring MVC

Total questions: 10

Worksheet time: 15mins

Name
Class
Date
1.

Which of the following element defines the base-package where DispatcherServlet will search the controller class?

a)

context:component-scan

b)

mvc:annotation-driven

c)

context:bean-scan

d)

none of these

2.

Which of the following is responsible for mapping the incoming request to the appropriate handler method in Spring MVC?

a)

DispatcherServlet

b)

HandlerMapping

c)

ViewResolver

d)

ModelAndView

3.

What does DispatcherServlet consult in Spring MVC to map the logical view name to a specific view implementation?

a)

Handler mapping

b)

View resolver

c)

Controller

d)

View

4.

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 _______________ 

a)

Model

b)

View

c)

Controller

d)

All of the above

5.

Where does the incoming request first reach in a Spring MVC application?

a)

Controller

b)

Model Object

c)

View

d)

DispatcherServlet

6.

What is the annotation used to map a method parameter to a URI template variable?

a)

@PathVariable

b)

@Path

c)

@PathLocale

d)

None of the mentioned

7.

@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.

a)

True

b)

False

8.

What is the correct annotation to declare a controller in Spring MVC?

a)

@Controller

b)

@ConfigController

c)

@SpringController

d)

@AppController

9.

Which of the following folder in spring mvc project contains web.xml?

a)

META-INF

b)

WEB-INF

c)

src folder

d)

Any of the above folders

10.

Which of the following is correct about spring mvc?

a)

A model contains the data of the application. A data can be a single object or a collection of objects.

b)

A controller contains the business logic of an application. Here, the @Controller annotation is used to mark the class as the controller.

c)

A view represents the provided information in a particular format. Generally, JSP is used to create a view page.

d)

In Spring Web MVC, the DispatcherServlet class works as the front controller. It is responsible to manage the flow of the Spring MVC application.

e)

All of the above