Java Enterprise Architecture Quiz - Patterns, Spring, and Servlets
Test your knowledge of software architecture concepts including design patterns, Spring framework, Java Servlets, and build tools
Questions
Attributes bound into session are available to any other servlet that belong to the same ServletContext?
- True
- False
Given req is an HttpServletRequest, which snippet creates a session if one doesn't exist?
- req.getSession(false);
- req.getSession(true);
- both the above
- none of the above
Which statements about ServletContext initialization parameters are not true?
- They should be used for data that changes rarely.
- They can be accessed using ServletContext.getInitParameter()
- They can be accessed using ServletContext.getParameter()
- They should be used for data that is applicable to an entire web application.
Which of the following methods are declared in ServletRequest?
- getMethod()
- getHeader()
- getCookies()
- getInputStream()
In the init(ServletConfig) method of Servlet life cycle, what method can be used to access the ServletConfig object ?
- getServletInfo()
- getInitParameters()
- getServletConfig()
- None
When do you use Spring in testing?
- Stress Testing
- Regression Testing
- Integration Testing
- None
Find the scope from the below list which is not defined in the Spring?
- singleton
- Prototype
- request
- response
Spring's bootstrap object that loads all the high-level (entry-point) objects that are required by your application. What we call this mechanism?
- Application scope
- Application Integration
- Application Context
- None
A Java class encapsulating one or more advices is called as ?
- A pointcut
- a join Point
- an Aspect
- None
Spring does not support one of the below dependency injection.?
- Constructor Injection
- Setter Injection
- interface Injection
- None
What are the types of the transaction management Spring supports?
- Programmatic transaction management.
- Declarative transaction management.
- Both 1 and 2
- None of the above
Which Tag in Ant will Invoke the build Process?
- Target
- Deploy
- Compile
- copy
How many targets can we create in the build.xml?
- 1
- 10
- 5
- Any number of targets
we can re-name the build.xml ?
- True
- False
which of the following tags to declare a variable in ant build script?
- property
- file
- variable
- declare
Root tag in Ant script?
- Project
- Root
- Directory
- folder
which tag used to display messages in the ant console ?
- print
- out
- write
- echo
which property in Target will invoke pre-targets?
- depends
- include
- pre-target
- none of the above
What is a Decorator pattern?
- decouple an abstraction from its implementation so that the two can vary independently
- One class takes in another class, both of which extend the same abstract class, and adds functionality.
- Assembles group of objects with same signature
- One class controls the creation of and access to objects in another class.
What is a Façade pattern?
- The reusable and variable parts of a class are broken into two classes to save resources
- One class controls the creation of and access to objects in another class.
- One class takes in another class, both of which extend the same abstract class, and adds functionality.
- One class has a method that performs a complex process calling several other classes.