Spring MCQ Quiz Hub

Spring Mcq Set 6

Choose a topic to test your knowledge and improve your Spring skills

To add attributes to the model.





✅ Correct Answer: 3

To access the binding and validation result for the command object.





✅ Correct Answer: 3

To notify its completion of session processing.





✅ Correct Answer: 3

Controller Class renders the objects passed by the controller’s handler method.





✅ Correct Answer: 3

Parameter used to specify a configuration file.





✅ Correct Answer: 1

The @RequestMapping annotation can be applied to the class level only.





✅ Correct Answer: 2

Bean classes pre-registered in the web application context by default.





✅ Correct Answer: 3

By default, @RequestMapping gets all the POST Requests.





✅ Correct Answer: 2

Callback methods provided by HandlerInterceptor to implement.





✅ Correct Answer: 4

Interface implemented by locale resolver.





✅ Correct Answer: 1

You can define a locale resolver by registering a bean of type LocaleResolver in the web application context.





✅ Correct Answer: 1

Default localeResolver used by Spring.





✅ Correct Answer: 3

AcceptHeaderLocaleResolver esolves locales by inspecting the accept-language header of an HTTP request.





✅ Correct Answer: 1

Alternative way to resolve locales.





✅ Correct Answer: 4

Property which indicates how many seconds this cookie should be persisted.





✅ Correct Answer: 1

Method used to change user’s locale.





✅ Correct Answer: 2

Property of LocaleChangeInterceptor used to customize parameter name.





✅ Correct Answer: 2

LocaleChangeInterceptor can only detect the parameter for the handler mappings that enable it.





✅ Correct Answer: 1

Parameter which can change user’s locale by any URL.





✅ Correct Answer: 3

Interface used to resolve text messages.





✅ Correct Answer: 4

Tag used by view to resolve text messages.





✅ Correct Answer: 1

The ResourceBundleMessageSource implementation resolves messages for different locales.





✅ Correct Answer: 1

cookieName is used by localeResolver to customize the cookie used.





✅ Correct Answer: 1

The cookieMaxAge value when browser is closed.





✅ Correct Answer: 3

Interface for Dispatcher Servlet to auto detect view resolver beans.





✅ Correct Answer: 3

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





✅ Correct Answer: 2

InternalResourceViewResolver resolves view names into view objects of type.





✅ Correct Answer: 1

By default, XmlViewResolver loads view beans from /WEB-INF/views.xml which is final.





✅ Correct Answer: 2

View beans from a resource bundle is loaded by.





✅ Correct Answer: 1

Views that can’t be resolved by InternalResourceViewResolver.





✅ Correct Answer: 1

Properties used to determine the correct content and type for a certain web requests.





✅ Correct Answer: 3

Inspection of header is done by which of the following.





✅ Correct Answer: 2

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





✅ Correct Answer: 1

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





✅ Correct Answer: 4

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





✅ Correct Answer: 1

To configure the exception mappings in the web application context.





✅ Correct Answer: 1

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





✅ Correct Answer: 1

SpEL statements are recognizable.





✅ Correct Answer: 1

Tag, used to define a location in which to place errors in case a form.





✅ Correct Answer: 4

To validate Java beans in a web application using annotations.





✅ Correct Answer: 4

Spring MVC supports generating Excel files using which of the following libraries.





✅ Correct Answer: 3

To use JSR-303 bean validation in a web application, dependencies to be added in maven.





✅ Correct Answer: 3

Annotation which indicates a field cannot be a null.





✅ Correct Answer: 2

Annotation used to indicate a field has to have a minimum of 2 characters.





✅ Correct Answer: 2

Annotation which receives a value in the form regexp=”.+@.+\.[a-z]+”.





✅ Correct Answer: 1

A field named validator is of type.





✅ Correct Answer: 1

Validator field is not assigned to any bean, but rather a factory class of the type.





✅ Correct Answer: 2

To hold any errors detected from validating the instance of beans.





✅ Correct Answer: 4

Spring doesn’t cope up with pdf and excel views.





✅ Correct Answer: 2

The view classes for Excel view is/are:-





✅ Correct Answer: 4