本文介绍了如何将Spring bean注入Apache Wink?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Spring托管的bean注入Apache Wink?

How do I inject Spring-managed beans into Apache Wink?

我在web.xml中启动了一个眨眼应用程序,如果我在其中的接口下插入虚拟数据服务@Autowired,则该应用程序会正常运行.我已经实现了JPA服务,以提供实现通过Spring 2.5.6设置的相同接口的数据.孤立地工作也很好.

I have a wink application started in web.xml that starts fine if I stub out a dummy data service @Autowired under an interface within it. I have implemented a JPA service to provide the data implementing the same interface, set up via Spring 2.5.6. This works fine in isolation too.

我想我只需要注入我的JPA服务而不是虚拟服务,但是我不知道该怎么做-尝试了@Service批注和<context:annotation-driven>;尝试手动注入JPA服务.就像Wink和Spring彼此不认识一样.

I think I just need to inject my JPA service instead of my dummy service, but I can't figure out how to do that - tried @Service annotations and <context:annotation-driven>; tried manually injecting the JPA service. It's like Wink and Spring aren't aware of each other.

Wink文档的确提到了Spring集成,但这是在谈论关于"Apache Wink核心上下文文件"的信息,我在Wink文档中找不到其他地方的提及.

The Wink docs do mention a Spring integration , however this talks about an "Apache Wink core context file" which I can't find mention of elsewhere in the Wink docs.

有人有什么主意吗?

推荐答案

"Apache Wink核心上下文文件" wink-core-context.xml是Spring配置文件.它是"wink-spring-support"的一部分.

The "Apache Wink core context file" wink-core-context.xml is a Spring configuration file.It is part of "wink-spring-support".

您可以在apache-wink-1.1.3-incubating-src\wink-spring-support\src\main\resources\META-INF\server

这篇关于如何将Spring bean注入Apache Wink?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-06 06:02