13.07.2015 Views

Spring Core Certification 3 Mock Exam - Java & Moi

Spring Core Certification 3 Mock Exam - Java & Moi

Spring Core Certification 3 Mock Exam - Java & Moi

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ResponseContainerQuestion 1Answer 2 is correct. Bean without Id is anonymous and cannot be referenced by their name. In thisquestion, the JpaDao bean is wired by its name by the MyServiceImpl bean. So JpaDao has to declarean jpaDao id attributeQuestion 2Answers 1 and 4 are correct.1. To set bean’s property with the p:propertyName shortcut, you have to declare thehttp://www.springframework.org/schema/p in your xml configuration file. No xsd isrequired.2. The bean is anonymous. No id is generated.3. To reference another bean with the p namespace, you have to use the p:propertyName-refsyntax4. Due to the above explanation, NationalBank is not a bean reference, so it is a simple Stringand thus a scalar value.Question 3Correct answer is 3.The @Bean annotation defines a String bean with the id "clientRepository". JpaClientRepository isthe implementation class of the bean. The data source is injected and is not declared in this class.Question 4The only possible answer is the number 3.1. The tag enables to reference a <strong>Java</strong> constant orenumeration into a spring configuration file2. ConstantPlaceholderConfigurer does not exist. You may think about thePropertyPlaceholderConfigurer bean post processor.3. The tag activates thereplacement of ${...} placeholders, resolved against the specified properties file.4. The c: namespace is for simplifying constructor syntax (since <strong>Spring</strong> 3.1) and don’t providesuch feature.Question 5The statements number 5 is right.1. You may auto-wiring properties by constructor, setter or properties in the same bean

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!