Spring MVC MCQs with answers Page - 1

Here, you will find a collection of MCQ questions on Spring MVC. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

S

Satya • 3.38K Points
Extraordinary

Q. What is Spring MVC?

  • (A) A database management system
  • (B) A Java web framework based on Model-View-Controller architecture
  • (C) A front-end JavaScript framework
  • (D) A testing framework

S

Satya • 3.38K Points
Extraordinary

Q. Which component receives all incoming HTTP requests in Spring MVC?

  • (A) ViewResolver
  • (B) DispatcherServlet
  • (C) Controller
  • (D) Model

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to define a controller class in Spring MVC?

  • (A) @Service
  • (B) @Component
  • (C) @Controller
  • (D) @Repository

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation maps HTTP requests to handler methods?

  • (A) @Autowired
  • (B) @RequestMapping
  • (C) @Bean
  • (D) @Qualifier

S

Satya • 3.38K Points
Extraordinary

Q. Which component resolves the logical view name to the actual view page?

  • (A) Model
  • (B) Controller
  • (C) ViewResolver
  • (D) HandlerMapping

S

Satya • 3.38K Points
Extraordinary

Q. What does the Model object hold in Spring MVC?

  • (A) Only configuration properties
  • (B) Application logs
  • (C) Data to be displayed on the view
  • (D) Database connections

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to bind request parameters to method arguments?

  • (A) @PathVariable
  • (B) @RequestParam
  • (C) @ModelAttribute
  • (D) @ResponseBody

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to return JSON response directly?

  • (A) @Controller
  • (B) @Service
  • (C) @ResponseBody
  • (D) @Repository

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation combines @Controller and @ResponseBody?

  • (A) @Component
  • (B) @RestController
  • (C) @Bean
  • (D) @Configuration

S

Satya • 3.38K Points
Extraordinary

Q. Which component maps the request URL to the appropriate controller?

  • (A) HandlerMapping
  • (B) ViewResolver
  • (C) ModelAndView
  • (D) BeanFactory

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ