<dependency> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> <version>1.3.2</version> </dependency> import javax.annotation.Resource; import javax.annotation.PostConstruct; public class MyClass { @Resource private SomeResource resource; @PostConstruct public void init() { // Initialization code } } <web-app> <webservice-ref> <webservice-ref-name>MyWebService</webservice-ref-name> <webservice-interface>com.example.MyWebServiceInterface</webservice-interface> <webservice-url>http://localhost:8080/myWebService</webservice-url> </webservice-ref> </web-app>


上一篇:
下一篇:
切换中文