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 # 5
Spring Framework Quiz # 5
Instructions
Quiz:
Spring Framework Quiz # 5
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 # 5
End Quiz
Question
1
of 30
00:00
Which of the following object hold the information of principal currently using the application?
SecurityContextLoader
SecurityContextHolder
InMemoryDaoImpl
UserDetailsService
Which one of the following statements is NOT true about the following configuration in security.xml <http ...> … <form-login login-page="/login/form" login-processing-url="/login" username-parameter="username" password-parameter="password" authentication-failure-url="/login/form?error"/> </http>
The password-parameter specifies the HTTP parameters of password that Spring Security will use to authenticate the user.
The login-page attribute specifies where Spring Security will redirect the browser if a protected page is accessed and the user is not authenticated.
The authentication-failure-url attribute specifies the page that Spring Security will redirect if Spring cannot find the login page.
The username-parameter specifies the HTTP parameters of username that Spring Security will use to authenticate the user.
Which of the following correctly describes TestContextManager of Spring TestContext Framework?
TestContextManager is the main entry point into the Spring TestContext Framework, but is NOT responsible EITHER for managing a single TestContext OR for signaling events to all registered TestExecutionListeners
TestContextManager is the main entry point into the Spring TestContext Framework, which is responsible for managing a single TestContext and signaling events to all registered TestExecutionListeners
TestContextManager is NOT the main entry point into the Spring TestContext Framework, but is responsible for managing a single TestContext and signaling events to all registered TestExecutionListeners
TestContextManager is the main entry point into the Spring TestContext Framework and is responsible for managing a single TestContext but NOT for signaling events to all registered TestExecutionListeners
Which is NOT a valid way of injecting a Collection in Spring?
<map>
<set>
<collection>
<props>
<list>
Which of the following Design Patterns is the common solution for the duplicated form submission problem in Spring MVC?
Singleton Pattern
Post/Redirect/Get
Factory Pattern
Proxy Pattern
Which of the following is NOT true about Spring Web Services?
Spring-WS require Spring 2.x or higher
Provides flexible XML Marshalling
Supports WS-Security
Supports integration with Acegi Security
Which one of the following statements is NOT true about Spring testing annotation?
@Repeat(5): This indicates that a test method has to run 5 times.
@Timed: This indicates that a test method must complete in a specified time period
@IfProfileValue:specifies testing environment of the testing method. Only one environment can be specified
@ExpectedException: This indicates that test method suppose to throw certain exception
How do you declare a destroy method in a Spring bean?
None of these
Using the destroy method
We cannot destroy, JVM takes take of it
Referencing as null
Which of the following is NOT a way to use Spring Web MVC's asynchronous request processing?
Return a Callable from the @RequestMapping method
Return a DeferredResult from the @RequestMapping method
Inject a TaskExecutor and pass it to the Session
Which of the following is NOT a valid spring framework module?
Spring ORM
Spring context
Spring AOP
Spring Bean Factory
Which view technologies does Spring Web MVC NOT support out of the box?
FreeMarker
Hibernate
Velocity
XSLT
Which one of the following statements is NOT true about the Application Context.
When configuring Application Context, Spring supports defining beans either through XML file or annotations starting from Spring 2.5
ApplicationContext is an interface and is an extension to BeanFactory interface.
ApplicationContext provides dependency Injection services and AOP service, but NOT transaction services.
In a web container environment, Spring bootstraps ApplicatonContext via the ConextLoaderListner.
Which of the following utility classes provides functionality to set a non-public field or invoke a non-public setter method when testing application code?
TestExecutionListeners
ReflectionTestUtils
TestContextManager
SpringJUnit4ClassRunner
Which one of the following statements is NOT true about the following code: @Service("jpaStudentService") @Repository @Transactional public class StudentServiceImpl implements StudentService { private Log log = LogFactory.getLog(StudentServiceImpl.class); @PersistenceContext private EntityManager em; // Other code omitted }
@Service is to identify that this class is a spring component providing business services.
@Transactional annotations describes transaction attributes of the class.
@PersistenceContext is a Spring annotation which instructs Spring to inject a SessionFactory
@Repository instructs Spring to translate the vendor-specific exceptions to Springs's DataAccessException hierachy.
What are benefits of transactions for Hibernate?
Transactions uses less memory and improves performance
Read only transactions prevent Hibernate from flushing session
There are no transactions in Hibernate
None of these
BeanFactory is a popular way to wire beans in Spring, which is a correct way of creating a BeanFactory?
BeanFactory factory = new XmlBeanFactory(new FileInputStream(“beans.xml”));
BeanFactory factory = new BeanFactory(new FileInputStream(“beans.xml”));
BeanFactory factory = new XmlBeanFactory(“classpath:beans.xml”);
BeanFactory factory = new BeanFactory(“beans.xml”);
Which one of the following statements is NOT true about @Transactional attributes
the default value of readOnly attribute is true
The timeout attribute defines the number in seconds for transaction time out.
The rollbackFor attribute defines which exception class will cause the transaction to roll back
If not specified the default value of propagation attribute is Propagation.REQUIRED
Which of the following is NOT true about Spring transaction management?
The Spring Framework gives you an opportunity to customize transactional behavior, using AOP
The Spring Framework support propagation of transaction contexts across remote calls
The Spring Framework provide a simpler API for programmatic transaction management than a number of complex transaction APIs such as JTA
The Spring Framework offers declarative rollback rules
How do you specify outgoing HTTP content-type?
Use the @ContentType annotation
Use the 'contentType' attribute of @RequestMapping
Use the 'produces' attribute of @RequestMapping
How do you specify the incoming HTTP content-type?
Use the @ContentType annotation
Use the 'consumes' attribute of @RequestMapping
Use the 'contentType' attribute of @RequestMapping
Which of the following identify the application-wide permissions available to a principal?
GrantedAuthority
Authentication
UserDetails
UserDetailsService
Which of the following best describes the utility of @RunWith(SpringJUnit4ClassRunner.class)?
This annotation will inject the SpringJUnit4ClassRunner bean in the test class
This annotation is indicating the test where to get the context files containing the bean definitions
This annotation means that tests are going to be able to get hold of instantiated beans as defined in the Spring context files
This annotation will facilitate the test to get hold of the ApplicationContext
What is the @BeforeTransaction annotation used for?
as part of testing, making sure some code is executed before the transaction is started
as part of Spring AOP, defining what to execute before the transaction is started
as part of Spring OXM, what to serialize before the transaction is started
What is the purpose of the SessionStatus.setComplete()?
Gets the the value of the "complete" attribute of the session.
Submits the form input from the user.
Expires the session Data of a controller.
Sets the attribute the session as "complete".
If you don't want a method to be enlisted in a transaction at all, what type of attribute can be used?
None of them
Both of them
@Transactional(readOnly = true)
@Transactional(propagation = Propagation.NEVER)
Which of the following is not a VALID mode of autowiring
byName
byType
autodetect
byClass
Which of the following is FIRST step in user authentication process?
The security context is established by calling SecurityContextHolder.getContext().setAuthentication(...), passing in the returned authentication object
The username and password are obtained and combined into an instance of UsernamePasswordAuthenticationToken
The AuthenticationManager returns a fully populated Authentication instance on successful authentication
The UsernamePasswordAuthenticationToken is passed to an instance of AuthenticationManager for validation
How can we create a PreparedStatementCreator?
createPreparedStatement(Connection)
createPreparedStatement(Datasource)
createPreparedStatement()
createPreparedStatement(Database)
Which of the following are valid approaches for integration Struts with Spring?
Extending Spring’s ActionSupport classes and getting applications spring-managed beans using getWebApplicationContext() method
Struts - Spring integration is not supported as of Spring 3.x
Any of the given approach can be used to integrate the two
Using ContextLoaderPlugin, configuring spring app to manage actions as beans and then setting their dependencies in a spring context file
A RowCallbackHandler has one method called?
processCallback(ResultSet)
processRow(ResultSet)
handleRowCallback(ResultSet)
processRowCallback(ResultSet)
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