【发布时间】:2023-11-18 13:47:01
【问题描述】:
我已经设置了一个基本的 Spring 框架 Web 应用程序,并且我开始从基于 XML 的配置切换到使用注释。我的服务器和 web 客户端在不同的机器上,所以我一直在使用 Spring HttpInvokerServiceExporter 来启用它们之间的远程处理。
客户:
<bean id="accountService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" value="${server.url}/AccountService"/>
<property name="serviceInterface" value="com.equinitixanite.knowledgebase.common.service.AccountService"/>
</bean>
服务器:
<bean name="accountService" class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
<property name="service" ref="accountService"/>
<property name="serviceInterface" value="example.AccountService"/>
我的问题是,我如何用注释做同样的结果? (我的意思是,我怎样才能避免在 XML 中声明每一个服务?)
【问题讨论】:
标签: spring service frameworks annotations remoting