Spring MVC MCQs with answers Page - 2

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 ModelAndView in Spring MVC?

  • (A) A database connection object
  • (B) An object holding both model data and view name
  • (C) A servlet filter
  • (D) A configuration file

S

Satya • 3.38K Points
Extraordinary

Q. Which file traditionally configures DispatcherServlet in XML-based Spring MVC?

  • (A) web.xml
  • (B) pom.xml
  • (C) hibernate.cfg.xml
  • (D) application.properties

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used to read values from the URL path?

  • (A) @RequestParam
  • (B) @PathVariable
  • (C) @Autowired
  • (D) @Bean

S

Satya • 3.38K Points
Extraordinary

Q. Which HTTP method is commonly mapped using @GetMapping?

  • (A) GET
  • (B) POST
  • (C) PUT
  • (D) DELETE

S

Satya • 3.38K Points
Extraordinary

Q. Which object helps transfer data between controller and view?

  • (A) HttpSession
  • (B) Model
  • (C) ServletContext
  • (D) FilterConfig

S

Satya • 3.38K Points
Extraordinary

Q. Which dependency is commonly used for JSP view support in Spring MVC?

  • (A) spring-jdbc
  • (B) spring-webmvc
  • (C) spring-orm
  • (D) spring-security

S

Satya • 3.38K Points
Extraordinary

Q. What is the purpose of @ModelAttribute?

  • (A) To inject dependencies
  • (B) To bind form data to a model object
  • (C) To configure database
  • (D) To create a bean

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation handles POST requests specifically?

  • (A) @PostMapping
  • (B) @PutMapping
  • (C) @DeleteMapping
  • (D) @PatchMapping

S

Satya • 3.38K Points
Extraordinary

Q. Spring MVC belongs to which module of Spring Framework?

  • (A) Core Container
  • (B) Data Access
  • (C) Web
  • (D) Messaging

S

Satya • 3.38K Points
Extraordinary

Q. Which class acts as the front controller in Spring MVC architecture?

  • (A) HandlerAdapter
  • (B) DispatcherServlet
  • (C) ApplicationContext
  • (D) ViewResolver

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