Loading

Quipoin Menu

Learn • Practice • Grow

spring / MVC Introduction
mcq
Direction: Choose the correct option

Q1.

What is Spring MVC?
A. A web framework built on Servlet API
B. A module of Spring for web development
C. Based on Model-View-Controller pattern
D. All of the above
Direction: Choose the correct option

Q2.

What is the DispatcherServlet in Spring MVC?
A. The front controller that handles all incoming requests
B. A servlet for dispatching views
C. A servlet for static resources
D. None
Direction: Choose the correct option

Q3.

Which annotation marks a class as a controller in Spring MVC?
A. @Controller
B. @RestController
C. @Component
D. @Service
Direction: Choose the correct option

Q4.

What is the purpose of @RequestMapping?
A. To map HTTP requests to handler methods
B. To define request parameters
C. To specify response type
D. To handle exceptions
Direction: Choose the correct option

Q5.

What does a Model object represent in Spring MVC?
A. Data to be passed to the view
B. The database model
C. The business logic
D. The request body
Direction: Choose the correct option

Q6.

What is a ViewResolver?
A. An interface that resolves view names to actual views
B. A resolver for JSON views
C. A class that renders HTML
D. None
Direction: Choose the correct option

Q7.

Which annotation is used to bind request parameters to method parameters?
A. @RequestParam
B. @PathVariable
C. @RequestBody
D. @ModelAttribute
Direction: Choose the correct option

Q8.

What does @ResponseBody do?
A. Indicates that the return value should be written directly to HTTP response body
B. Defines a response entity
C. Sets the response status
D. None
Direction: Choose the correct option

Q9.

What is the default HTTP method handled by @RequestMapping if not specified?
A. All methods (GET, POST, etc.)
B. GET
C. POST
D. GET and POST
Direction: Choose the correct option

Q10.

How do you configure Spring MVC in a web application?
A. Using Java config with @EnableWebMvc
B. Using XML configuration
C. Using Spring Boot auto-configuration
D. All of the above