我有以下Spring服务:
@Service
public class Worker {
@Autowired
private MyExecutorService executor;
@Autowired
private IRun run;
private Integer startingPoint;
// Remainder omitted
}
现在,我想通过.properties文件加载startingPoint.
是否可以通过注释和xml上下文同时连接Spring服务?
也许是这样的:
<bean id="worker" class="Worker">
<property name="startingPoint">
<value>${startingPoint}</value>
</property>
</bean>
最佳答案