InterviewSolution
| 1. |
What Are The Jsr-250 Annotations? Explain Them.? |
|
Answer» Spring has JSR-250 based annotations which INCLUDE @POSTCONSTRUCT, @PreDestroy and @Resource annotations. @PostConstruct: This annotation can be USED as an ALTERNATE of initialization callback. @PreDestroy: This annotation can be used as an alternate of destruction callback. @Resource : This annotation can be used on fields or setter METHODS. The @Resource annotation takes a 'name' attribute which will be interpreted as the bean name to be injected. You can say, it follows by-name autowiring semantics. Spring has JSR-250 based annotations which include @PostConstruct, @PreDestroy and @Resource annotations. @PostConstruct: This annotation can be used as an alternate of initialization callback. @PreDestroy: This annotation can be used as an alternate of destruction callback. @Resource : This annotation can be used on fields or setter methods. The @Resource annotation takes a 'name' attribute which will be interpreted as the bean name to be injected. You can say, it follows by-name autowiring semantics. |
|