29
Passit4sure.CoreSpringV3.2.97 questions Number : CoreSpringV3.2 Passing Score : 800 Time Limit : 120 min File Version : 4.5 http://www.gratisexam.com/ CoreSpringV3.2 Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. Guys just read this only. Finally, I got right questions for this exam and share with you guys. Best Wishes. Best stuff I have ever used for my exam preparation. I love Exam collection guys. I have corrected few questions and now score will be 95% above Guaranteed. Created Questions into Sections, now we can learn by Sections with this help.

CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

  • Upload
    others

  • View
    6

  • Download
    1

Embed Size (px)

Citation preview

Page 1: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Passit4sure.CoreSpringV3.2.97 questions

Number: CoreSpringV3.2Passing Score: 800Time Limit: 120 minFile Version: 4.5

http://www.gratisexam.com/

CoreSpringV3.2

Core-Spring (based on Spring 3.2)

Excellent Questions, I pass with 90% with these questions. Guys just read this only.

Finally, I got right questions for this exam and share with you guys. Best Wishes.

Best stuff I have ever used for my exam preparation. I love Exam collection guys.

I have corrected few questions and now score will be 95% above Guaranteed.

Created Questions into Sections, now we can learn by Sections with this help.

Page 2: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Exam A

QUESTION 1Select which statement(s) is/are true with respect to programming to interfaces with Spring

A. The use of interfaces allows for reduced coupling between collaborating objectsB. Spring requires all beans to implement interfacesC. Spring requires that parameters in constructors and setters are defined using interface typesD. Spring requires all beans to have an empty constructor (either default or declared)

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 2Consider the following class:public class LegacySingleton {private LegacySingleton(){}public static LegacySingleton getAServiceInstance() {return new LegacySingleton();}}How can a bean of type LegacySingleton be created (using XML configuration)? (select one)

A. It is not possible, the constructor must be publicB. Use the factory-method attribute on the <bean> tagC. Use the init-method attribute on the <bean> tagD. Use autowiring

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 3Which of the following scenarios requires you to instantiate an ApplicationContext using the `new'keyword? (Select one)

A. Running your Spring application inside a JUnit test (using SpringJUnit4ClassRunner)B. Bootstrapping your Spring application within a Java main() methodC. Deploying your Spring application in an application server, packaged in a WAR fileD. Both a and b

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 4Consider the following code sample which creates an ApplicationContext from a file called "application-config.xml" in the "rewards.internal" package, and a file called test-infra-config.xml in the current folder:ApplicationContext context = newFileSystemXmlApplicationContext("classpath:rewards.internal.application-config.xml", "file:test- infra-config.xml");

Page 3: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Which of those statements is true? (select one)

A. The use of the "file" prefix is not necessaryB. The use of the "classpath" prefix is not necessaryC. The use of the "." separator is correctD. Both a and b

Correct Answer: ASection: (none)Explanation

Explanation/Reference:nicely done.

QUESTION 5Which of the following statements is NOT true with respect to Spring's ApplicationContext? (select one)

A. The ApplicationContext eagerly instantiates all singleton beans by defaultB. There are many different implementation classes which all implement the ApplicationContext interfaceC. When available, the close() method will cause any registered bean destruction code to be invokedD. In a JUnit test using Spring support (with @ContextConfiguration annotation), it is necessary to close

the ApplicationContext manually

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 6Select which of the following configuration tasks would be implemented using Spring's XML "context"namespace (select one or several answers)

http://www.gratisexam.com/

A. Enabling component-scanningB. Enabling the use of the @Transactional annotationC. Enabling the use of the @Required, @PreDestroy and @PostConstruct annotationsD. Enabling the use of the @Around annotation

Correct Answer: ACSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 7Which of the following statements about the BeanFactoryPostProcessor are true? (select one or severalanswers)

A. Allows for the transformation of Spring bean definitions before the beans are instantiated

Page 4: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

B. Allows for the transformation of Spring beans after the beans have been instantiatedC. Detects annotations such as @PostConstruct and @PreDestroy and then invokes appropriate behaviorD. The <context:property-placeholder /> tag causes a BeanFactoryPostProcessor to be created

Correct Answer: ADSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 8Identify which statement indicates potential advantages of using Spring's Dependency Injection (select one)

A. Dependencies between application components can be managed external to the componentsthemselves

B. Configuration can be externalized and centralized in a small set of filesC. Integration testing is made easier because different components used for testing can easily be injectedD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 9You want to externalize constants from your Spring XML configuration file into a .properties file to yourSpring beans. Which mechanism could you use? (select one)

A. Use a PropertyEditorB. Use a PropertyPlaceholderConfigurerC. Use <util:constant ... />D. Use a BeanPostProcessor

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 10Which of the following statements about the @PostConstruct annotation is NOT true? (select one)

A. It is a JSR-250 standard Java annotationB. There are no restrictions on method name or visibility of a method which can be annotated with

@PostConstructC. It can be enabled using the <context:annotation-config /> tagD. It is called before setter injection

Correct Answer: DSection: (none)Explanation

Explanation/Reference:well answered.

QUESTION 11

Page 5: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Using Spring AOP, which of the following Spring annotations cause behavior to be added (select one)

A. @SecuredB. @TransactionalC. Both a and bD. Neither a or b

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 12Two beans of type MyBean are defined in the ApplicationContext with singleton scope, with ids "myBean1"and "myBean2". The getBean() method is called once for each bean. Which statement is true about thetwo references returned? (Select one)

A. The two references refer to different instances of the same typeB. Both references refer to the same bean instanceC. One of the references will be nullD. A RuntimeException will be thrown when the ApplicationContext is initialized

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

http://www.gratisexam.com/

QUESTION 13Which of the following statements is NOT true concerning Setter Injection or Constructor Injection? (Selectone)

A. Constructor injection is useful when you must have an instance of a dependency class before yourcomponent is used

B. Setter injection is useful if a component can provide its own defaultsC. Using the @Autowired annotation, setter injection also works when the setter method is privateD. Using setters promotes immutability

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 14If you annotate one of your classes with @Component, which of the following should you do to have Springautomatically detect your class and load it as a bean? (Select one or several answers)

Page 6: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

A. Ensure that you specify a valid bean name in the @Component annotationB. Ensure that you specify a valid @Scope for the beanC. Ensure that you have added <context:component scan> in the XML configurationD. Ensure that <context: annotation-config/> is specified in the XML configuration

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 15Which of the following statements about use of the @Transactional annotation in a JUnit integration test isNOT true? (Select one)

A. Annotating a test with @Transactional will cause the test method to run in a transactionB. Annotating a test class with @Transactional will cause all its test methods to run in transactionsC. Application code that runs in a transaction with REQUIRES_NEW propagation can have those changes

rolled back by an @Transactional test

Correct Answer: CSection: (none)Explanation

Explanation/Reference:good answer.

QUESTION 16Which of the following statements best describes the benefits of using the Spring Framework with respectto unit testing? (Select one)

A. Your Java code typically has dependencies on Spring Framework classes which are designed to makethe job of unit testing easier

B. The Spring Framework encourages you to program to interfaces which makes it easier to stub or mockout dependencies in your code

C. The extensive runtime checks performed by the ApplicationContext when it initializes make traditionalunit testing less important

D. All of the above

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 17Which of the following statements about Spring and unit testing is true? (Select one)

A. Spring provides an internal mock framework so there is no need for a third-party mock framework suchas Mockito or EasyMock

B. Spring provides an abstraction to existing Mock frameworksC. Both a and bD. Neither a or b

Correct Answer: DSection: (none)Explanation

Page 7: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Explanation/Reference:Explanation:

QUESTION 18Which of the following statements about Spring's JUnit integration testing support is true? (select one)

A. A new ApplicationContext is initialized and created for each test methodB. To obtain references to the Spring bean(s) you want to test, you need to call getBean() on the

ApplicationContext providedC. You can indicate which XML configuration files the test class will use to create the ApplicationContextD. All of the above

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 19import com.springsource.service.*;...@Configurationpublic class AppConfig {@Beanpublic ClientService clientService() {return new ClientServiceImpl();}}What is the id of the declared bean? (Select one)

A. clientService (starting with lower-case "c")B. ClientService (starting with capital "C")C. com.springsource.service.ClientServiceD. com.springsource.service.ClientServiceImpl

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 20public class AppConfig {public ClientService clientService() {return new ClientServiceImpl();}}The Spring Java configuration above is NOT correct. Why? (select one)

A. The class should be annotated with @ConfigurationB. The method should be annotated with @BeanC. Both (a) and (b)D. Neither (a) or (b)

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

Page 8: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Explanation:

QUESTION 21@Configurationpublic class AppConfig {@Beanpublic ClientService clientService() {ClientServiceImpl clientService = new ClientServiceImpl(); clientService.addClientDao(new ClientDao());return clientService;}In the example above, which statement is NOT true with regards to Spring Java configuration? (select one)

A. The declared bean is a singleton by defaultB. This bean might be wrapped by a proxyC. This bean cannot use a method starting with "add" to inject a dependencyD. The bean is of type ClientService

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 22ClientService service = applicationContext.getBean(ClientService.class) Which statement is true withregards to the above example? (select one)

A. It returns the bean called "ClientService"B. It returns a bean of the type ClientService (regardless of its id or name)C. This syntax is not valid because the bean id must be specified as a method paramD. This syntax is not valid because the result of the getBean method should be explicitely cast into

ClientService

Correct Answer: BSection: (none)Explanation

Explanation/Reference:proper answer.

QUESTION 23Identify the correct statement about the following pointcut expression. Assume that these 2 classes do notinherit from one another:Execution (* rewards.service.MyClass.*(..)) && execution(* rewards.service2.MyOtherClass.*(..)) (Selectone)

A. Executions of all public method calls in MyClass and MyOtherClass will be selected by this pointcutB. Public methods in MyClass and MyOtherClass which take zero arguments will not be selected by this

pointcutC. Public methods in MyClass and MyOtherClass which take more than one argument will not be selected

by this pointcutD. This pointcut will never select any join points

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

Page 9: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

QUESTION 24Which of the following statements is NOT true concerning the BeanPostProcessor Extension point? (Selectone)

A. BeanPostProcessors are called during the init phaseB. BeanPostProcessors are called after the dependencies have been injectedC. BeanPostProcessors are called before the BeanFactoryPostProcessors have been calledD. Custom BeanPostProcessors can be implemented

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 25Identify the correct statement(s) about the following pointcut expression:

execution(* rewards.restaurant.*Service.find(..))

A. The target's type should end with "Service"B. The target method name could be "findRestaurantById"C. The target method should have one argument onlyD. The target method may have several arguments

Correct Answer: ADSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 26Identify the correct statement(s) about the following pointcut expression:

execution(* rewards..restaurant.*.*(*)) (select one or several answers)

A. There may be several directories between 'rewards' and 'restaurant'B. There is no restriction on the class nameC. The target method may have several argumentsD. The return type must not be "void"

Correct Answer: ABSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 27Identify the correct statement about the following pointcut expression:

execution(@javax.annotation.security.RolesAllowed * rewards.restaurant.*.*(..)) (Select one)

A. The return type of the target method is RolesAllowedB. All method parameters should be annotated with @RolesAllowedC. The target method may have one argumentD. All of the above

Page 10: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 28Which of the following statements defines a "pointcut"? (select one)

A. A point in the execution of a program such as a method call or field assignmentB. A module that encapsulates advicesC. An expression that selects one or more join pointsD. None of the above

Correct Answer: CSection: (none)Explanation

Explanation/Reference:appropriate answer.

QUESTION 29Which of the following statements defines an "aspect"? (select one)

A. An encapsulation of advice combined with a pointcut.B. A point in the execution of a program such as a method call or field assignmentC. An expression that selects one or more join pointsD. Code to be executed at a join point that has been selected by a Pointcut

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 30Identify the correct statement(s) regarding the following pointcut:execution(@com.springsource.MyCustomAnnotation void *(..))

A. Spring does not support annotations inside its pointcut expression languageB. This will select join points representing void methods that are annotated by

@com.springsource.MyCustomAnnotationC. This will select join points representing methods that may have a public, protected or default visibilityD. This pointcut will in no situation ever be able to select any join points

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 31Identify the correct statement(s) regarding the <aop:aspectj-autoproxy /> tag (Select one or multipleanswers)

A. Can only be used with AspectJ (as opposed to Spring AOP)

Page 11: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

B. Enables the detection of @Aspect annotated classesC. Allows to define a list of names to include so Spring is not going to scan all the beans at startup

Correct Answer: BCSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 32Consider the following bean definition<bean id="clientService" class="com.springsource.service.ClientServiceImpl" /> Using Spring AOP, youhave declared a Pointcut targeting all methods inside the clientService bean.ClientServiceImpl implements 3 different interfaces.

Which interfaces will the proxy class implement? (Select one)

A. All interfacesB. The proxy class does not implement any interfaceC. A Spring bean should never implement any interface

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 33Which statement concerning Aspect Oriented Programming (AOP) is true (Select one)

A. AOP modularizes cross-cutting concernsB. Spring AOP implements aspects using the Proxy patternC. Three of the advice types are "before", "after" and "around"D. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:absolute answer.

QUESTION 34Which of the following statements is NOT true about Spring AOP? (Select one)

A. "private" methods cannot be advised, but all other method visibilities can beB. Proxy classes are created at startup time by defaultC. The "After Throwing" advice type executes after the join point, but executes only if the advised method

threw an exceptionD. The "After" advice type is invoked regardless of whether a method successfully returned or an

exception is thrown

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

Page 12: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

QUESTION 35To register for a bean destruction callback, one can (Select one)

A. Decorate the destroy method with @PreDestroyB. Decorate the destroy method with @PreDestroy and add a <context:annotation-config /> xml

declarationC. Set the bean instance in a "prototype" scopeD. Set the lazy-init attribute within the <bean> tag

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 36Which of the following statements best describes the After Returning advice type? (select one)

A. After Returning advice allows behavior to be added after a method either returns successfully or throwsan exception

B. Custom processing can be performed before a join point executesC. The advice has complete control over the method invocationD. The advice is invoked only if the method returns successfully

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 37Which of the following statements best describes the After Throwing advice type? (select one)

A. The advice is executed after a method invocation throws an exceptionB. Custom processing can be performed before a join point executesC. The advice is invoked only if the method returns successfullyD. The advice is designed to allow exceptions thrown from a join point to be caught and prevented from

propagating up the stack

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 38Which statement best describes the advantage of using AfterReturning advice, rather than simply usingafter advice? (Select one)

A. If an exception is thrown in the join point, it is allowed to propagate, which is not the case with Afteradvice

B. AfterReturning advice is invoked if an exception is thrown, which is not the case with After adviceC. After advice can only be applied to methods which are declared as voidD. AfterReturning advice is only invoked if the method returns successfully, allowing you to limit advice to

only those scenarios

Page 13: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Correct Answer: DSection: (none)Explanation

Explanation/Reference:actual answer.

QUESTION 39Which of the following statements about Pointcut expressions is true? (Select one)

A. A Pointcut can be defined either within annotations in Java code or within XML configurationB. A pointcut expression can include operators such as the following: && (and),|| (or), ! (not)C. A Pointcut expression can be used to select join points which have been annotated with a specific

annotationD. All of the above is true

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 40Which of the following statements is NOT true about advice types and exception handling? (select one)

A. If a Before advice method throws an exception, the target method will not be calledB. An Around advice type can swallow, or halt the propagation of, an exception thrown by the target

method.C. An AfterReturning advice type can swallow, or halt the propagation of, an exception thrown by the target

method.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 41Which of the following statements is NOT true about advice types (select one)

A. The Before advice method is able to obtain information about the target method's return typeB. The After advice method is able to obtain information about the target method's return typeC. The Before advice method is able to obtain the target method's return valueD. The After advice method is able to obtain the target method's return value

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 42Which of these is NOT a characteristic of Spring JDBC? (Select one)

A. Can be configured exclusively using annotationsB. Provides a callback approach when greater developer control is needed

Page 14: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

C. Connections are acquired and released from the DataSource automaticallyD. Translation of root cause checked exceptions to Spring DataAccessExceptions

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 43Which of the following statements is NOT a characteristic of Spring Transaction Management? (Selectone)

A. It abstracts the differences between local and JTA transactionsB. It simplifies migration to distributed transactionsC. The use of JTA transactions is a requirementD. Both declarative and programmatic transaction management is supported

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 44Which statement is NOT a characteristic of Spring's PlatformTransactionManager base interface (selectone)

A. When declaring a PlatformTransactionManager implementation inside Spring configuration: as arequirement, the bean id should be "transactionManager"

B. The PlatformTransactionManager interface abstracts the differences between local and JTAtransactions

C. There are various implementations of JTA transaction managers for different Java EE containersD. PlatformTransactionManager is used in both declarative and programmatic transaction management

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 45Which of the following statement(s) is/are true concerning Spring Transactions? (Select one or severalanswers)

A. Spring only provides support for declarative transaction management, there is no programmatic supportB. Spring provides declarative transactions only using XMLC. An AOP pointcut can be used to define which methods to advise for transactionsD. Spring's tx namespace enables a concise definition of transactional advice

Correct Answer: CDSection: (none)Explanation

Explanation/Reference:correct choice is selected.

Page 15: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

QUESTION 46Which of the following is a valid optional attribute for a transaction definition? (select one)

A. Propagation behaviorB. An isolation levelC. A read-only flagD. All of the above

http://www.gratisexam.com/

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 47If the propagation behavior is Propagation.REQUIRED, choose the statement which describes thepropagation behavior (select one)

A. Executes in a transaction if one already exists. If there is no transaction, it executes without atransaction context.

B. Executes in a transaction if one already exists. Throws an exception if there is no active transaction.C. Executes in a nested transaction if an active transaction exists. If there is no transaction, it starts a new

one.D. Executes in a transaction if one already exists. If there is no transaction, it starts a new one.

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 48If the propagation behavior is Propagation.REQUIRES_NEW, choose the statement which describes thepropagation behavior (select one)

A. Runs in a nested transaction if an active transaction exists. If an active transaction does not exist, thetransaction behaves as if Propagation.REQUIRED is set

B. Supports a transaction if one already exists. Throws an exception if an active transaction does notexist.C. Always starts a new transaction. If an active transaction already exists, it is suspendedD. Always executes without a transaction even if an active transaction exists. Throws an exeception if

anactive transaction exists.

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 49

Page 16: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Which of the following is the correct mechanism for using programmatic transactions in Spring? (Selectone)

A. Use of the @Transactional annotation on each method which should be transactionalB. Use of the @Transactional annotation on the Class of methods which should all be transactionalC. Configuration in an XML configuration file using the Spring "tx" namespaceD. Use of the Spring TransactionTemplate

Correct Answer: DSection: (none)Explanation

Explanation/Reference:truely answered.

QUESTION 50public class ClientServiceImpl implements ClientService { @Transactional(propagation=Propagation.REQUIRED)public void update1() {update2();}@Transactional(propagation=Propagation.REQUIRES_NEW)public void update2() { // ... }}

You are using transactions with Spring AOP. What is happening when the update1 method is called?(Select one)

A. There is only one transaction because the call to update2() is internal (it does not go through the proxy)B. There is only one transaction because REQUIRES_NEW runs into the active transaction if one already

existsC. There are 2 transactions because REQUIRES_NEW always runs in a new transaction

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 51Consider that all Spring beans have been declared within a package called "com.springsource.service". Toenable component scanning one must do the following:

A. Nothing (component scanning is enabled by default)B. Add <context:annotation-config/> to your XML configurationC. Add <context:component-scan base-package="com.springsource.service"/> to your XML configurationD. Remove all other bean definitions from the XML configuration

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 52Using declarative transaction management, by default a transaction rolls back if:

A. Any uncaught exception that inherits from Exception has been thrown

Page 17: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

B. Any uncaught exception that inherits from RuntimeException has been thrownC. Any uncaught Throwable that inherits from Throwable has been thrownD. Null is being returned by a non-void method

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 53@Transactional(timeout=60)public class ClientServiceImpl implements ClientService { @Transactional(timeout=30)public void update1() {}}

What timeout setting is applied to the timeout inside the update1 method? (Select one)

A. 60B. 30C. This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the

class levelD. This will not compile. Attributes such as timeout, propagation and isolation cannot be declared at the

method level

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 54@Transactionalpublic class ClientServiceImpl implements ClientService { //...}

Using Spring AOP, you have declared @Transactional at the class level. It applies to:

A. All methods within the ClientServiceImpl classB. All public methods within the ClientServiceImpl classC. All methods within the class that have been declared by the ClientService interfaceD. This will not compile. @Transactional cannot be declared at the class level

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 55Which of the following statements about the Spring DispatcherServlet is NOT true? (select one)

A. It is an abstract Servlet class which much be subclassed to provide mapping and business logicB. It delegates to Web intrastructure beans such as ViewResolvers and ControllersC. It is a "front controller" which coordinates all HTTP request handling activities for Spring MVCD. It is defined in web.xml just like any other servlet

Page 18: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 56Which of the following statements about Spring @MVC is NOT true (select one)

A. Classes annotated with @Controller annotation can be detected by component scanning and loaded asSpring beans

B. Data can be passed from the controller to the view by use of the special Model parameterC. Controllers are typically able to delegate to business methods in an application because a reference to

a service bean can be injected into the controllerD. The DispatcherServlet, controller beans and other collaborators are all defined and configured in

web.xml

Correct Answer: DSection: (none)Explanation

Explanation/Reference:satisfied answer.

QUESTION 57Which is the correct statement regarding the relationship between a DispatcherServlet ApplicationContextand a root ApplicationContext (select one)

A. The root ApplicationContext can reference beans in the DispatcherServlet Application context, but notvice-versa

B. The DispatcherServlet ApplicationContext can reference beans in the root Application context, but notvice-versa

C. The DispatcherServlet ApplicationContext and the root ApplicationContext can reference each other'sbeans

D. The DispatcherServlet ApplicationContext and root ApplicationContext are completely isolated andcannot reference each other's beans

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 58Which of the following is NOT true about @Controller-annotated classes? (Select one)

A. They are eligible for handling requests in Spring MVC.B. They must implement a special interface.C. They can be discovered via component scanning.D. They can be configured as Spring beans via XML configuration.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

Page 19: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

QUESTION 59Which of the following is NOT a characteristic of Spring Remoting? (Select one)

A. It has its own proprietary naming directory service that remote services are published toB. It supports multiple protocols and multiple forms of object serializationC. It uses polymorphism on the client so that client code can be agnostic to whether it is using a remote

service or local objectD. Spring beans can be published as remote services by simply adding configuration

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 60Which of the following statements is true concerning Spring's HttpInvoker remoting protocol? (select one)

A. HttpInvoker requires a web server to be running on the serverB. HttpInvoker is a synchronous remoting mechanismC. The client invokes remote methods on the server using an HTTP POSTD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:truthfully.

QUESTION 61Which of the following statements comparing traditional RMI with Spring RMI is NOT true? (select one)

A. Traditional RMI requires the client to catch RemoteExceptions, but Spring's approach does notB. Traditional RMI requires implementing java.rmi.Remote, but Spring's approach does notC. Both approaches require you to extend the UnicastRemoteObject class on the server sideD. Both approaches require method parameters and return values to implement java.io.Serializable

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 62Security filters are used in Spring Security in which ways? (select one)

A. To drive authenticationB. To enforce authorization of web requestsC. To provide a logout capabilityD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:

Page 20: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Explanation:

QUESTION 63Which of the following strategies is correct for configuring Spring Security to intercept particular URLs?(Select one)

A. The URLs are specified in the XML configuration using the <intercpt-url> tag, with the most specificmatch first and the least specific last

B. The URLs are specified in the XML configuration, with the least specific match first and the mostspecific last

C. The URLs are specified in a special properties file, used by Spring SecurityD. The URLs can only be specified in web.xml as part of the Servlet mapping

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 64Which of the following statements is NOT a characteristic of Spring Security? (select one)

A. It provides a strict implementation of the Java EE Security specificationB. Authentication data can be accessed using a variety of different mechanisms, including databases and

properties filesC. Security can be configured at the method levelD. Tag libraries are provided for displaying security context information in JSP pages

Correct Answer: ASection: (none)Explanation

Explanation/Reference:absolute answer.

QUESTION 65What is the principal purpose of Spring's Security tag library? (Select one)

A. To provide a mechanism for applying security to Spring Web ServicesB. To allow certain URLs to be tagged as requiring secure accessC. To provide functionality in JSP pages, such as hiding certain sections based on rolesD. To allow Spring Security to be applied to XHTML

Correct Answer: CSection: (none)Explanation

Explanation/Reference:no doubt at answer.

QUESTION 66Which of the following statements is true concerning configuring JMS Resources with Spring? (Select one)

A. Spring cannot use a standalone JMS providerB. Spring can use the JMS resources provided by an application serverC. The ConnectionFactory cannot be standaloneD. The ConnectionFactory cannot be retrieved from JNDI

Page 21: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 67Which of the following statement is true concerning Spring's JmsTemplate (select one)

A. The JmsTemplate manages resources transparently (e.g. Connections, default Queue...)B. The JmsTemplate converts checked JMSExceptions to runtime equivalentsC. The JmsTemplate provides convenience methods and callbacksD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 68Which of the following methods is NOT provided by the JmsTemplate? (select one)

A. setDefaultDestinationB. onMessage (asynchronous call)C. convertAndSendD. receiveAndConvert (synchronous call)

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

http://www.gratisexam.com/

QUESTION 69Consider the following Spring JMS configuration<jms:listener-container connection-factory="connectionFactory"> <jms:listener destination="order.queue"ref="orderListener" method="order"/> </jms:listener-container>

Which of the following statements is truE. (select one)

A. Spring will automatically receive messages from the order.queue.destinationB. The orderListener bean has to implement javax.jms.MessageListener or Spring's

SessionAwareMessageListener interfaceC. The application needs to run in an application server that provides a JMS implementation out of the boxD. Spring will automatically send a response message

Correct Answer: ASection: (none)

Page 22: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Explanation

Explanation/Reference:well answered selected.

QUESTION 70Select which statement is true with respect to constructor injection with Spring (select one)

A. Multiple parameters can be dependency injected into a constructorB. Using XML configuration, the constructor-arg element may be omitted if the constructor requires a

single parameterC. One single bean cannot mix constructor injection with setter injectionD. All of the above

Correct Answer: ASection: (none)Explanation

Explanation/Reference:right answer.

QUESTION 71Consider the following complete configuration sample:<bean class="rewards.internal.RewardNetworkImpl"><property name="accountRepository" ref="accountRepository"/> </bean><bean class="rewards.internal.account.JdbcAccountRepository"/>

Which of the following statements is true? (Select one)

A. This configuration is correctB. This configuration is not valid because the first bean should have an id. Its value should be

"rewardNetwork".C. This configuration is not valid because the second bean should have an id. Its value should be

"accountRepository".D. Both (b) and (c)

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 72When injecting scalar/literal values into Spring beans, which of the following statements is true? (selectone)

A. Scalar values cannot be injected into setters or constructors with primitive type parametersB. Spring performs automatic type conversion for certain data types, such as String to intC. In XML Spring configuration, you can inject scalar values using the ref attribute of the <property /> tagD. All of the above

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 73

Page 23: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Which of the following statements about the FactoryBean interface is NOT true? (select one)

A. A FactoryBean can be used to generate Spring beans of any typeB. The Spring configuration <property name="someValue" ref="myFactoryBeanImpl"/> will ALWAYS inject

the instance of the FactoryBean implementationC. FactoryBean is a Spring interfaceD. Factory objects used in Spring do not necessarily have to implement the FactoryBean interface

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 74Method level security can be configured using which of the following mechanisms? (select one)

A. Using the @Secured annotation on methods to be securedB. Using the @RolesAllowed annotation on methods to be securedC. Configuring using a pointcut expression in Spring XML configuration fileD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 75In what order will these events occur during the initialization of the application? (Select one) Select the bestresponse1 Setter Dependency Injection2 Bean constructor3 call BeanFactoryPostProcessors4 call BeanPostProcessors

A. 3, 2, 1, 4B. 4, 2, 1, 3C. 2, 1, 4, 3D. 3, 1, 2, 4

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 76Consider the following Spring Security configuration<security:http><security:intercept-url pattern="/accounts/*" access="ROLE_USER" /> <security:intercept-url pattern="/accounts/editAccount.htm" access="ROLE_ADMIN" /> </<security:http>

In order to access to "/accounts/editAccount.htm", what role is required? (select one)

A. ROLE_USERB. ROLE_ADMIN

Page 24: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

C. Both ROLE_USER and ROLE_ADMIND. No role is required

Correct Answer: ASection: (none)Explanation

Explanation/Reference:right answer.

QUESTION 77Select which of the following is a mechanism which can be used with Spring Security to store user details(select one)

A. DatabaseB. LDAPC. Properties fileD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 78What is the principal purpose of Spring's Security XML namespace? (Select one)

A. To provide a mechanism for applying security to Spring Web ServicesB. To provide a schema for configuring Spring Security in a Spring XML configuration fileC. To provide a mechanism for encrypting Spring Security XML configuration filesD. To allow Spring Security to be applied to XHTML

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 79Which of the following data access technologies does Spring support? (Select one)

A. JDBCB. JPAC. JBoss HibernateD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 80Choose the statement that does NOT apply to Spring's JdbcTemplate (select one)

A. All JdbcTemplate methods throw SQLExceptions which you are required to handle

Page 25: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

B. The JdbcTemplate provides methods for query executionC. The JdbcTemplate provides the ability to work with result setsD. The JdbcTemplate does not write or generate SQL statements for you

Correct Answer: ASection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 81State which operation is not performed by the JdbcTemplate (select one)

A. Acquisition of the connectionB. Definition of the DataSourceC. Execution of the statementD. Release of the connection

Correct Answer: BSection: (none)Explanation

Explanation/Reference:right choice of answer.

QUESTION 82Spring puts each bean instance in a scope. The default scope is (select one)

A. singleton except when using Java ConfigurationB. singleton (no matter which Dependency Injection style has been used)C. prototypeD. request

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 83State which type of object the JdbcTemplate can be used to query (select one)

A. Simple types (int, long, String, etc)B. Generic MapsC. Domain ObjectsD. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 84Which of the following statements is true with respect to Spring's support for Object-Relational Mapping(ORM) libraries (select one)

Page 26: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

A. Spring supports management of Hibernate Sessions or JPA PersistenceContexts in combination withlocal transactions

B. Spring provides support for translating exceptions thrown from ORM libraries into Spring's ownexception hierarchy

C. Spring provides FactoryBeans to configure each of the supported ORM librariesD. All of the above is true

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 85Which of the following is NOT true about the @RequestMapping annotation? (select one)

A. It is an annotation for mapping web requests to controller methods.B. It is commonly used for component scanning purpose.C. You can use it only with @Controller annotated classes.

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 86Assuming a web application context name of "rewardsonline", a servlet mapping of "/admin/*", and anincoming URL of "/rewarsdonline/admin/accounts/show", what is the URL used for Spring MVC request-mapping purposes? (select one)

A. /rewardsonline/admin/accounts/showB. /admin/acounts/showC. /accounts/showD. /show

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 87Which of the following statements is NOT true concerning Spring Remoting? (Select one)

A. Spring exporters handle the binding to a registry or exposing an endpointB. Spring provides FactoryBeans that generate proxies to handle client-side requirementsC. The client-side implementation must catch RemoteExceptionsD. Spring proxies convert RemoteExceptions to a runtime exception hierarchy

Correct Answer: CSection: (none)Explanation

Explanation/Reference:answers are right can be checked online or any other right source.

Page 27: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

QUESTION 88Which is the correct way to declare that a spring-enabled JUnit 4 integration test should rollbacktransactions upon completion? (Select one)

A. The test should create a TransactionManager instanceB. Test case must extend AbstractTransactionalSpringContextTestsC. Annotate the method or the class with @TransactionalD. Method name must begin with test

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 89Which of the following protocols is NOT supported by Spring Remoting? (select one)

A. RMIB. CORBAC. HttpInvoker

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 90Spring's RMI Service Exporter provides which of the following services? (select one)

A. Transparently exposes an existing POJO service to the RMI registryB. Avoids the service interface having to extend RemoteC. Exposes services that can be accessed via plain RMID. All of the above

Correct Answer: DSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 91Which statement is NOT true concerning Spring's RMI Proxy Generator (select one)

A. Spring provides a FactoryBean implementation that generates the RMI client-side proxyB. The client-side proxy converts checked RemoteExceptions into Spring's runtime hierarchy of

RemoteAccessExceptionsC. The proxy does not have to dynamically implement the interface of the remote service implementationD. The client-side proxy contains all necessary information to connect to the remote service, such as the

RMI Registry URL

Correct Answer: CSection: (none)Explanation

Explanation/Reference:

Page 28: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Explanation:

QUESTION 92What is the primary purpose of bean definition inheritance? (Select one or several answers)

A. To configure Java class inheritance dynamically within the XML bean definition fileB. To reduce the amount of configuration required by inheriting properties from other bean definitionsC. To allow Spring beans to be created on the fly from classes declared as abstractD. To simplify configuration by allowing multiple properties files to be loaded in a hierarchy to specify bean

properties

Correct Answer: BSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 93What is true regarding bean definition inheritance?

A. Parent bean definitions should always be abstractB. Parent bean definitions may be abstractC. The class attribute can be declared in a parent bean definitionD. It is not useful to declare an id for a parent bean definition

Correct Answer: BCSection: (none)Explanation

Explanation/Reference:corrected answer.

QUESTION 94<bean name="clientService" class="com.foo.ClientServiceImpl" p:name="myName"/> Which of thefollowing statements is true regarding the above code sample? (Select one)

A. This syntax requires the declaration of the "p" namespaceB. myName is a scalar value (as opposed to a reference to an existing bean)C. Both a and bD. Neither a or b

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 95Which of the following statements about the @Autowired annotation is NOT true? (select one)

A. The default behavior is that if a dependency cannot be satisfied with @Autowired, theApplicationContext will throw a RuntimeException

B. @Autowired is a Spring-specific annotationC. Multiple arguments can be injected into a single method using @AutowiredD. It cannot be used to annotate fields, only constructors and methods

Correct Answer: D

Page 29: CoreSpringV3.2 Core-Spring (based on Spring 3.2)€¦ · 13/3/2015  · Core-Spring (based on Spring 3.2) Excellent Questions, I pass with 90% with these questions. ... C. Detects

Section: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 96Given an ApplicationContext containing multiple bean definitions of a Java type "Foo", which of thefollowing @Autowired scenarios will cause the ApplicationContext to FAIL to initialize? Assume that theApplicationContext is configured to process the @Autowired annotations. (Select one)

A. @Autowired public void setFoo(Foo aFoo) {}B. @Autowired private Foo foo;C. Both a and bD. Neither a or b

Correct Answer: CSection: (none)Explanation

Explanation/Reference:Explanation:

QUESTION 97Which of the following are valid mechanisms of autowiring a dependency when multiple beans match thedependency's type? (Select one or several answers)

A. Use of the @Qualifier and @Autowired annotations together on a fieldB. Use of the @Qualifier and @Autowired annotations together with setter methodsC. Use of the @Qualifier annotation solely

Correct Answer: ABSection: (none)Explanation

Explanation/Reference:Explanation:

http://www.gratisexam.com/