我正在开发一个 GWT-Spring-Hibernate 项目,我想在 GWT Service Servlet 中使用 Spring Autowired 注释,但是我的自动注释服务没有被注入(inject)。它是空的。是否有我遗漏的配置细节?
我加
<context:annotation-config />
<context:component-scan base-package="com.org" />
到我的 ApplicationContext.xml 并且我已经将我的服务注释为 @Service("myService")
@Autowired
MyService myService; // This is null so WHY?
最佳答案
您需要在初始化期间“ Autowiring ”您的 RPC servlet。看这里http://code.google.com/p/gwt-spring-starter-app/
关于java - GWT 项目中的 Spring 配置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1761524/