服务端webservice注入问题

J2EE 码拜 9年前 (2015-04-11) 1280次浏览 0个评论

webservice类
public class TccontInfoWebservice {

}
接口
public interface UserService{

}
接口的实现类
public interface UserServiceImpl implments  UserService{

}
比如我想把UserService注入到TccontInfoWebservice 中,
public class TccontInfoWebservice {
@Autowired
UserService userService;
}
那么TccontInfoWebservice 和UserServiceImpl 要加什么注解才行

服务端webservice注入问题
20分
都加spring的bean注解就行,@Service或则@Component, 只要保证都被扫描到就行。
服务端webservice注入问题
20分
将UserServiceImpl注解为component(“userService”)

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明服务端webservice注入问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!