Which mechanism could you use?

You want to externalize constants from your Spring XML configuration file into a .properties file to your Spring beans. Which mechanism could you use? (select one)A . Use a PropertyEditorB . Use a PropertyPlaceholderConfigurerC . Use <util:constant ... />D . Use a BeanPostProcessorView AnswerAnswer: B

February 28, 2020 No Comments READ MORE +

What is true regarding bean definition inheritance?

What 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 definitionView AnswerAnswer: B,C

February 28, 2020 No Comments READ MORE +

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

Select which statement(s) is/are true with respect to programming to interfaces with SpringA . 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...

February 27, 2020 No Comments READ MORE +

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

Which 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, the ApplicationContext will throw a RuntimeExceptionB . @Autowired is a Spring-specific annotationC . Multiple arguments can be injected into a single method...

February 25, 2020 No Comments READ MORE +

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

Which of the following are valid mechanisms of autowiring a dependency when multiple beans match the dependency’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...

February 25, 2020 No Comments READ MORE +

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

Which 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...

February 25, 2020 No Comments READ MORE +

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

Which 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 such as Mockito or EasyMockB . Spring provides an abstraction to existing Mock frameworksC . Both a and bD...

February 24, 2020 No Comments READ MORE +

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

Select which of the following configuration tasks would be implemented using Spring's XML "context" namespace (select one or several answers)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 annotationView...

February 24, 2020 No Comments READ MORE +

What is the id of the declared bean? (Select one)

What is the id of the declared bean? (Select one) import com.springsource.service.*; ... @Configuration public class AppConfig { @Bean public ClientService clientService() { return new ClientServiceImpl(); } }A . clientService (starting with lower-case "c")B . ClientService (starting with capital "C")C . com.springsource.service.ClientServiceD . com.springsource.service.ClientServiceImplView AnswerAnswer: A

February 22, 2020 No Comments READ MORE +

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

Which 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...

February 22, 2020 No Comments READ MORE +