Spring Questions and Answers – Securing and persisting objects in Web Flows

«
»

This set of Java Spring Multiple Choice Questions & Answers (MCQs) focuses on “Securing and persisting objects in Web Flows”.

1. Element which secures web flows.
a) secured
b) security
c) sec
d) none of the mentioned
View Answer

Answer: a
Explanation: With Spring Security configured properly, you can simply secure a flow, a state, or a transition by embedding the secured element with required access attributes specified.
advertisement

2. To secure web flows with Spring Security.
a) DelegatingFilter
b) DelegatingFilterProxy
c) DelegatingProxy
d) None of the mentioned
View Answer

Answer: b
Explanation: To secure web flows with Spring Security, you first have to configure a DelegatingFilterProxy filter in the web deployment descriptor (i.e., web.xml).

3. Group id to add spring security using Maven.

<dependency>
   <groupId></groupId>
   <artifactId>spring-security-core</artifactId>
   <version>3.0.2.RELEASE</version>
</dependency>

a) org.springframework.secure
b) org.springframework.security
c) org.springframework.securedflow
d) none of the mentioned
View Answer

Answer: b
Explanation: org.springframework.secur is used to secure web flows with Spring Security.

4. auto-config provides only default form-based login service.
a) True
b) False
View Answer

Answer: b
Explanation: HTTP auto-config, which provides a default form-based login service, an anonymous login service, and so on.
advertisement

5. To enable Spring security for web flows.
a) SecurityFlowExecutionListener
b) SecurityFlowExecution
c) FlowSecurity
d) SecurityFlowListener
View Answer

Answer: a
Explanation: You have to register the flow execution listener SecurityFlowExecutionListener in the flow executor to enable Spring Security for web flow.

6. Which of the following class should replace ‘?’.

<beans ...>
...
  <webflow:flow-executor id="flowExecutor">
  <webflow:flow-execution-listeners>
  <webflow:listener ref="securityFlowExecutionListener" />
  </webflow:flow-execution-listeners>
  </webflow:flow-executor>
  <bean id="securityFlowExecutionListener" class="?" />
</beans>

a) org.springframework.webflow.security.SecurityFlow
b) org.springframework.webflow.SecurityFlowExecutionListener
c) org.springframework.webflow.security.SecurityFlowExecutionListener
d) org.springframework.security.SecurityFlowExecutionListener
View Answer

Answer: c
Explanation: You have to register the flow execution listener SecurityFlowExecutionListener in the flow executor to enable Spring Security for web flow.

7. Which attribute is used to access security element of web flow.
a) attribute
b) attributes-security
c) attributes
d) none of the mentioned
View Answer

Answer: c
Explanation: You can specify multiple access attributes required for accessing this web flow in the attributes attribute, separated by commas.

8. Spring web flow supports integration with.
a) JSF
b) Hibernate
c) JPA
d) All of the mentioned
View Answer

Answer: d
Explanation: Spring Web Flow 2.0 comes with support for JPA and Hibernate.
advertisement

9. To integrate JPA with Spring Web flows.
a) JpaFlowExecutionListener
b) HibernateFlowExecutionListener
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: a
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener (e.g., JpaFlowExecutionListener for JPA.

10. To integrate Hibernate with Spring Web flows.
a) JpaFlowExecutionListener
b) HibernateFlowExecutionListener
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: b
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener (e.g., HibernateFlowExecutionListener for Hibernate.

11. HibernateFlowExecutionListener and JpaFlowExecutionListener both belongs to which of the package.
a) org.springframework.web.persistence package
b) org.springframework.persistence package
c) org.springframework.webflow package package
d) org.springframework.webflow.persistence package
View Answer

Answer: d
Explanation: JpaFlowExecutionListener for JPA and HibernateFlowExecutionListener for Hibernate, both of which belong to the org.springframework.webflow.persistence package) in the flow executor.

12. JpaFlowExecutionListener and Hibernate Listener binds to flow scope.
a) True
b) False
View Answer

Answer: a
Explanation: . When a new flow starts, this listener creates a new persistence context (e.g., a JPA entity manager or a Hibernate session) and binds it to the flow scope.

13. Libraries used to integrate Hibernate with JPA.
a) Hibernate 3
b) Hibernate 3 Entity Manager
c) JPA API
d) All of the mentioned
View Answer

Answer: d
Explanation: To use Hibernate as the JPA engine, you have to add Hibernate 3, the Hibernate 3 EntityManager, the JPA API, and ehcache.

14. To configure JPA vendor-specific information.
a) JPA vendor adaptor
b) Data source
c) All of the mentioned
d) None of the mentioned
View Answer

Answer: c
Explanation: you can configure a JPA entity manage factory by providing a data source and a JPA vendor adaptor, where you can configure JPA vendor-specific information.

15. You have to register a flow execution listener in the flow executor.
a) True
b) False
View Answer

Answer: a
Explanation: To have Spring Web Flow manage the persistence contexts for your web flows, you have to register a flow execution listener in the flow executor.

Sanfoundry Global Education & Learning Series – Java Spring.
To practice all areas of Java Spring, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn