Login
Sign up
Categories
IT & Programming
Design & Multimedia
Writing & Translation
Sales & Marketing
Admin Support
Engineering & Manufacturing
Finance & Management
Website Designing & Development
Database Management
Networking & Troubleshooting
Aviation & Aerospace
Softwares & Applications
Stocks & Investments
Electronics & Appliances
Online Tools
General Knowledge & Aptitude
Mathematics
Educational Subjects & Courses
Business & Organization
Health & Wellbeing
Culture & Ethics
IT Field Knowledge & Experience
Languages & Communication
Entrepreneurship & Leadership
Economics & Development
Mass Communication & Media
Research Methods & Evaluation
Public Relations & Dealings
Educational Methods and Research
Educational Subjects & Techniques
Crime & Justice
Governments & Policies
Cyber Security & Ethical Hacking
Hospitality & Tourism
Soft Skills & Personal Management
Transportation & Driving Rules
Forest and Nature
Religion
Skill Assessment
MCQs
PDFs
Login
Sign up
Categories
IT & Programming
Design & Multimedia
Writing & Translation
Sales & Marketing
Admin Support
Engineering & Manufacturing
Finance & Management
Website Designing & Development
Database Management
Networking & Troubleshooting
Aviation & Aerospace
Softwares & Applications
Stocks & Investments
Electronics & Appliances
Online Tools
General Knowledge & Aptitude
Mathematics
Educational Subjects & Courses
Business & Organization
Health & Wellbeing
Culture & Ethics
IT Field Knowledge & Experience
Languages & Communication
Entrepreneurship & Leadership
Economics & Development
Mass Communication & Media
Research Methods & Evaluation
Public Relations & Dealings
Educational Methods and Research
Educational Subjects & Techniques
Crime & Justice
Governments & Policies
Cyber Security & Ethical Hacking
Hospitality & Tourism
Soft Skills & Personal Management
Transportation & Driving Rules
Forest and Nature
Religion
Skill Assessment
MCQs
PDFs
Login
Sign up
Skill Assessments
>
IT & Programming
>
Spring Framework Skill Assessment
>
Quiz # 7
Spring Framework Quiz # 7
Instructions
Quiz:
Spring Framework Quiz # 7
Subject:
Basic Spring Framework
Total Questions:
30 MCQs
Time:
30 Minutes
Note
Do not refresh the page while taking the test.
Results along with correct answers will be shown at the end of the test.
Start Quiz
Spring Framework Quiz # 7
End Quiz
Question
1
of 30
00:00
Which of the following development styles are supported by Spring WS?
Contract First but NOT Contract Last
Both Contract First and Contract Last
Supports Contract First, Contract Last and Web service contract (WSDL)
Contract Last but NOT Contract First
Which of the following is NOT a filter type in <context:component-scan> element?
annotation
bean
aspectj
assignable
When are proxies generated in the Spring lifecycle?
None of These
Bean Post Processing
Does not happen in springs
Bean Pre Processing
Which one of the following statements is true about the following configuration in web.xml: <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class> org.springframework.web.filter.DelegatingFilterProxy </filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/myapplication/*</url-pattern> </filter-mapping>
Spring Security will intercept forwards, includes, or errors.
It doesn't matter if Spring Security to be declared as first <filter-mapping> element.
It configures springSecurityFilterChain to intercepts all the requests.
The <filter-name> value for the DelegatingFilterProxy must be "springSecurityFilterChain".
How can you find out about the current content when an aspect is invoked?
Through Joinpoint
Through PointCut
Through ApplicationContext
Through BeanFactory
Which the following statements is true about Spring validation?
All of these
When using annotation to valid domain object, only one validation annotation is allowed for each property
Custom validation can be implemented through Spring's support of JSR-303, the Bean Validation API
@NotNull annotations indicates that the value should not be empty
When detecting a Device device in a @Controller in Spring MVC, which of these is NOT supported?
device.isMobile()
device.isTablet()
device.isDesktop()
device.isNormal()
Which of these is correct when creating an ApplicationContext?
ApplicationsContext ctx = new ClasspathXmlApplicationsContext("one.ctx","two.ctx");
ApplicationContext ctx = new ClasspathXmlApplicationContext("one.ctx","two.ctx");
ApplicationContext ctx = new ClasspathXmlApplicationContext("one.ctx”);
None of these
How filters are used in Spring Web?
Filters are called before a request hits the DispatcherServlet. They allow for interception-style, chained processing of web requests for security, timeouts, and other purposes.
Filters are used with a checksum algorithm that will filter invalid bytes out of a byte stream request body and allow for processing of HTTP requests from the DispatcherRequestServlet.
Filters are used with a checksum algorithm that will filter invalid bytes out of an octet stream a multipart upload and allow for chained processing of WebDispatcherServlet requests.
Filters are used to validate request parameters out of the byte stream request body and allow for processing of requests from the DispatcherRequestServlet.
How is a resource defined in the context of a REST service?
A resource is the actual String literal that composes a URI that is accessed on a RESTful web service.
It is an abstract concept that represents a typed object, data, relationships, and a set of methods that operate on it that is accessed via a URI.
A REST service has a pool of resources composed of allocations of memory that allow a request to be processed.
A resource for a REST service is an explicit allocation of a thread or CPU cycles to allow a request to be processed.
Which of these is a valid Advice annotation?
@AfterError
@AfterReturning
@AfterException
@AfterExecution
What does a ViewResolver do?
It supports internationalization of web applications by detecting a user's locale.
It generates a view by mapping a logical view name returned by a controller method to a view technology.
It creates a unique view determined by the uers's browser type,supporting cross-browser compatibility.
It maps custom parameters to SQL views in the database, allowing for dynamic content to be created in the response.
How are Spring Data repositories implemented by Spring at runtime?
Spring automatically generated code for you based on your YAML config that defined a MethodInterceptor chain that intercept calls to the instance and computed SQL on the fly.
A JDK proxy instance is created, which backs the repository interface, and a MethodInterceptor intercepts calls to the instance and routes as required.
The Spring JDK proxy creates a separate runtime process that acts as an intermediary between the database and the Web server, and intercepts calls to the instance and handles requests.
Spring automatically generated code for you based on your XML config files that define a SpringMethodAutoGeneration factory that intercepts calls to the instance and creates dynamic method that computer SQL on the fly.
What is SpEL and how is it used in Spring?
SpEL(Spring Expression Language) runs in the JVM and can act as a drop-in replacement for Groovy or other languages.
SpEL(Spring Expression Language) supports boolean and relational operators and regular expressions, and is used for querying a graph of objects at runtime.
SpEL(Spring Expression Language) allows you to build, configure,and execute tasks such as building artifacts and downloading object dependencies.
SpEL(Spring Expression Language) natively transpiles one JVM language to another, allowing for greater flexibility.
The process of linking aspects with other objects to create an advised object is called
Dynamic chaining
Banding
Weaving
Interleaving
How are JDK Dynamic proxies and CGLIB proxies used in Spring?
JDK Dynamic proxy can proxy only interface, so it is used if the target implements at least one interface. A CGLIB proxy can create a proxy by subclassing and is used if the target does not implement an interface.
Only JDK Dynamic proxies are used in the Spring Bean Lifecycle. CGLIB proxies are used only for integrating with other frameworks.
Only CGLIB proxies are used in the Spring Bean Lifecycle. JDK Dynamic proxies are used only for integrating with other frameworks.
JDK Dynamic proxy can only using an abstract class extended by a target. A CGLIB proxy can create a proxy through bytecode interweaving and is used if the target does not extend an abstract class.
Which of these is not a valid method on the JoinPoint interface?
GetArgs()
GetExceptions()
GetSignature()
GetTarget()
In what order do the @PostConstruct annotated method, the init-method parameter method on beans and the afterPropertiesSet() method execute?
1. afterPropertiesSet() 2. init-method 3. @PostConstruct
1. @PostConstruct 2. afterPropertiesSet() 3. init-method
1. init-method 2. afterPropertiesSet() 3. @PostConstruct
You cannot use these methods together-you must choose only one.
What is the function of the @Transactional annotation at the class level?
It's a transaction attribute configured by spring.security.transactions.xml config file that uses Spring's transaction implementation and validation code.
It's a transaction that must actively validate by the bytecode of a transaction using Spring's TransactionBytecodeValidator class. Default Transaction behavior rolls back on validation exception but commits on proper validation
It creates a proxy that implements the same interface(s) as the annotated class, allowing Spring to inject behaviors before, after, or around method calls into the object being proxied.
It's a transaction that must be actively validated by Spring's TransactionValidator class using Spring's transaction validation code. Default Transaction behavior rolls back on validation exception.
What is the root interface for accessing a Spring bean container?
SpringInitContainer
ResourceLoader
ApplicationEventPublisher
BeanFactory
Which annotation can be used within Spring Security to apply method level security?
@Secured
@RequiresRole
@RestrictedTo
@SecurePath
What is the purpose of the @Lazy annotation and why would you use it?
It prevents a bean from being created and injected until you run a specific CLI command. It reduces complexity in the application.
It can be applied to a bean so that the bean is not persisted in the database. It reduces the number of database operations.
It can be applied to a bean so that the bean is not created and injected until it is needed. It can help speed up startup time for your application.
It prevents a bean from being created and injected until it receives a HTTP request to a callback hook. It reduces disk footprint.
What is dependency injection?
A method by which objects define dependencies they need as abstractions that allows the framework to instantiate and configure them in a central location at runtime.
A paradigm where dependent code is injected into the bytecode of a Java application on a remote server.
A way of injecting remote dependencies into a pre-packaged JAR file from the file system.
A way of injecting remote dependencies into a pre-packaged WAR file from the file system.
What is a RESTful web service?
Reactive Enterprise Status Transfer is a web service comprising a set of guidelines and technical constraints for web services that monitor and alert of a set of mission-critical resources.
Representational State Transfer an architectural style for creating web services that includes client-server architecture, statelessness, cacheability, a layered system, and a uniform interface.
Redundant Enumerated State Transfer is a web service that provides redundancy in the case of failure and outlines technical constraints for web services that have access to resources.
Reactive Enterprise State Transfer is a web service comprising a set of guidelines and technical constraints for web services y that have access to resources and are async in nature.
What happens when a class is annotated with the @Controller annotation?
A controller bean definition is defined in the servlet's WebApplicationContext. The class is marked as a web component, and you can map requests to controller methods.
A controller bean definition is defined in the Web Context, and Web Servlet is marked as a component that reads mapped controller requests from an XML config file.
A controller bean definition is defined in the Tomcat Context, and the Controller Servlet is marked as a web component that reads mapped controller requests from a YAML config file.
A controller bean definition is defined in the Servlet Context, and the Controller Servlet is marked as a component that reads mapped controller requests from an XML config file.
Which property can be used to change the port of a Spring application?
Port
Spring.port
Spring.settings.port
Server.port
What is the purpose of the @ResponseBody annotation?
To validate the char array contained in a response to ensure that it is a valid character encoding
To generate a local byte stream from the body of a response that allows a request to be scanned for security risks
To indicate whether a handler method return value should be bound to the web response body in servlet environments
To ensure a ThreadLocal byte stream that allows a response to be encoded for reading directly into a socket stream
How are mocking frameworks such as Mockito used with Spring?
Mockito will spin up a mock web service hosted in a Docker container that can respond to HTTP requests to mock out third-party APIs.
Mockito can use annotations or factory methods to create mock objects that may be injected into tests in place of dependencies. The behavior of mocks can be explicitly configured.
Mockito will create mock users to repeatedly perform requests against your Spring application to test your app's ability to take load.
Mockito will spin up a mock web service hosted in a Docker container that can respond to RPC calls to mock out remote resources.
What is the name of the central servlet that dispatches requests to controllers?
DispatchingDelegatorServlet
DispatcherServlet
Router
FrontControllerServlet
What is the purpose of the Spring IoC (Inversion of Control) container?
It instantiates and configures objects, supplied at runtime, to classes that define them as a dependency.
It allows the front-end code to manage the ResponseBody objects provided by a back-end REST API.
It allows a database to define business objects via a shared schema at compile time.
It facilitates a remote server to configure a local application.
Submit Test
Prev Question
ABCd
Next Question
Spring Framework Skill Assessment
Login to see Skill Score (It's Free)
Your Skill Level:
Poor
Retake Quizzes to improve it
Start Assessment
Spring Framework Skill Assessment
Login to see Skill Score (It's Free)
Your Skill Level:
Poor
Retake Quizzes to improve it
Start Assessment