Test Series - spring

Test Number 13/20

Q: To prevent the characters in your script from conflicting with the reserved XML characters
A. Use ![CDATA[…]] tag
B. Use ![DATA[…]] tag
C. Use ![CDATA(…)] tag
D. None of the mentioned
Solution: You no longer have to specify the reference to the external script source file in the script-source attribute.
Q: Dynamic-language-backed bean with some configurations
A. Refreshable bean
B. Beanshell
C. Scripting Beans
D. Inline Script
Solution: A refreshable bean is a dynamic-language-backed bean that with a small amount of configuration, a dynamic-language-backed bean can monitor changes in its underlying source file resource, and then reload itself when the dynamic language source file is changed.
Q: To quickly add a Spring Validator implementation to a Spring MVC Controller
A. Use inline-script
B. lang:inline-script
C. All of the mentioned
D. None of the mentioned
Solution: If we put to one side the issues surrounding whether it is good practice to define dynamic language source inside a Spring configuration file, the lang:inline-script/ element can be useful in some scenarios.
Q: Script’s location is specified by attribute
A. script-source
B. xml-source
C. script-annotation
D. none of the mentioned
Solution: Specifying the script’s location in the script-source attribute.
Q: Way to secure web app’s URL.
A. servlet filters
B. refresh-check-delay
C. http servlet filters
D. none of the mentioned
Solution: Spring Security enables you to secure a web application’s URL access in a declarative way through simple configuration. It handles security by applying servlet filters to HTTP requests.
Q: Servlet filter registered in web deployment descriptor, which filters request in spring application context.
A. DelegatingFilter
B. DelegatingFilterProxy
C. DelegatingProxy
D. None of the mentioned
Solution: As servlet filters must be registered in the web deployment descriptor to take effect, you have to register a DelegatingFilterProxy instance in the web deployment descriptor, which is a servlet filter that delegates request filtering to a filter in Spring’s application context.
Q: Servlet APIs to access security information of web application.
A. HttpServletRequest.isUserInRole()
B. HttpServletRequest.getUserPrincipal()
C. None of the mentioned
D. All of the mentioned
Solution: Servlet API integration: This allows you to access security information in your web application via standard Servlet APIs, such as HttpServletRequest.isUserInRole() and HttpServletRequest.getUserPrincipal().
Q: To load root application context at the start up.
A. ContextListener
B. ContextLoader
C. ContextLoaderListener
D. ContextEventListener
Solution: In the web deployment descriptor (i.e., web.xml), you register ContextLoaderListener to load the root application context at startup.
Q: To dispatch requests for web application.
A. DispatcherServlet
B. ViewHandler
C. ViewResolver
D. None of the mentioned
Solution: Spring MVC DispatcherServlet is used to dispatch requests.
Q: The responsibility of DelegatingFilterProxy is simply to delegate HTTP request filtering to a Spring bean that implements the interface:-
A. java.util.logging.Filter
B. java.util.logging.net
C. java.util.logging.FilterHttp
D. none of the mentioned
Solution: The responsibility of DelegatingFilterProxy is simply to delegate HTTP request filtering to a Spring bean that implements the java.util.logging.Filter interface.

You Have Score    /10