Explore topic-wise MCQs in Spring.

This section includes 7 Mcqs, each offering curated multiple-choice questions to sharpen your Spring knowledge and support exam preparation. Choose a topic below to get started.

1.

Annotation which allows a controller s field to be assigned using Spring Expression Language(SpEL)

A. @Value
B. @After
C. @Default
D. @None
Answer» B. @After
2.

In a Spring MVC application, you can register one or more exception resolver beans in the web application context to resolve uncaught exceptions.

A. True
B. False
Answer» B. False
3.

The ContentNegotiatingViewResolver resolver first determines the media type for a request based on which of the following criteria?

A. It checks a request path extension
B. If a request path has an extension but no match can be found in the default mediaTypes section of the ContentNegotiatingViewResolver bean
C. If no extension is present in a request path, the HTTP Accept header of the request is used
D. All of the mentioned
Answer» E.
4.

ContentNegotiatingViewResolver resolver configuration sets up the resolver to have the highest priority among all resolvers.

A. True
B. False
Answer» B. False
5.

Inspection of header is done by which of the following.

A. InternalViewResolver
B. ContentNegotiatingViewResolver
C. ContentNegotiating
D. InternalResolver
Answer» C. ContentNegotiating
6.

Views that can t be resolved by InternalResourceViewResolver.

A. redirect
B. redirect:prefix
C. redirect:suffix
D. all of the mentioned
Answer» B. redirect:prefix
7.

ViewResolver which maps each view name tol an application s directory.

A. InternalViewResolver
B. InternalResourceViewResolver
C. InternalResolver
D. None of the mentioned
Answer» C. InternalResolver