Spring MVC MCQs with answers Page - 4

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. Which annotation is used to send HTTP status codes in response?

  • (A) @ResponseStatus
  • (B) @ExceptionHandler
  • (C) @ControllerAdvice
  • (D) @CrossOrigin

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation is used for global exception handling in Spring MVC?

  • (A) @ExceptionHandler
  • (B) @ControllerAdvice
  • (C) @Service
  • (D) @Repository

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation handles exceptions inside a controller?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which annotation allows cross-origin requests?

  • (A) @CrossOrigin
  • (B) @Origin
  • (C) @Allow
  • (D) @CorsMapping

S

Satya • 3.38K Points
Extraordinary

Q. Which mapping annotation is used for HTTP PUT requests?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which mapping annotation is used for HTTP DELETE requests?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which method parameter type gives access to request headers?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which resolver determines handler execution order?

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

S

Satya • 3.38K Points
Extraordinary

Q. Which feature allows executing logic before and after controller execution?

  • (A) Filter
  • (B) HandlerInterceptor
  • (C) Servlet
  • (D) BeanPostProcessor

S

Satya • 3.38K Points
Extraordinary

Q. What does ContentNegotiatingViewResolver do?

  • (A) Chooses view type based on request format
  • (B) Handles database queries
  • (C) Manages session objects
  • (D) Creates beans

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