SpringSource Core-Spring (based on Spring 3.2) 認定 CoreSpringV3.2 試験問題:
1. ClientService service = applicationContext.getBean(ClientService.class)
Which statement is true with regards to the above example? (select one)
A) This syntax is not valid because the bean id must be specified as a method param
B) This syntax is not valid because the result of the getBean method should be explicitely cast into ClientService
C) It returns a bean of the type ClientService (regardless of its id or name)
D) It returns the bean called "ClientService"
2. Assuming a web application context name of "rewardsonline", a servlet mapping of "/admin/*", and an incoming URL of "/rewarsdonline/admin/accounts/show", what is the URL used for Spring MVC request-mapping purposes? (select one)
A) /rewardsonline/admin/accounts/show
B) /accounts/show
C) /admin/acounts/show
D) /show
3. Using declarative transaction management, by default a transaction rolls back if:
A) Any uncaught exception that inherits from Exception has been thrown
B) Null is being returned by a non-void method
C) Any uncaught Throwable that inherits from Throwable has been thrown
D) Any uncaught exception that inherits from RuntimeException has been thrown
4. Which of the following is the correct mechanism for using programmatic transactions in Spring? (Select one)
A) Use of the @Transactional annotation on the Class of methods which should all be transactional
B) Configuration in an XML configuration file using the Spring "tx" namespace
C) Use of the @Transactional annotation on each method which should be transactional
D) Use of the Spring TransactionTemplate
5. 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 field
B) Use of the @Qualifier and @Autowired annotations together with setter methods
C) Use of the @Qualifier annotation solely
質問と回答:
質問 # 1 正解: C | 質問 # 2 正解: B | 質問 # 3 正解: D | 質問 # 4 正解: D | 質問 # 5 正解: A、B |