grails 远程处理插件 - 总是 404?
我正在尝试向 Spring Web 应用程序公开远程接口,但遇到了问题,总是收到 404。我下面的设置有什么问题吗?
Grails:
服务 - 包 mypackage
class RemoteUserService implements RemoteUserServiceInterface {
static expose = ['httpinvoker']
User findUser(String userId) {
return User.findByUserId(userId);
}
}
src/groovy/mypackage
class RemoteUserService implements RemoteUserServiceInterface {
static expose = ['httpinvoker']
User findUser(String userId) {
return User.findByUserId(userId);
}
}
Spring:
mypackage
public class MyController extends AbstractController {
RemoteUserServiceInterface remoteUserService
}
appContext
<bean id="viewController" class="mypackage.MyController">
<property name="remoteUserService" ref="remoteUserService"/>
</bean>
<bean id="remoteUserService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/grails-app-name/httpinvoker/RemoteUserService"/>
<property name="serviceInterface" value="mypackage.RemoteUserServiceInterface"/>
</bean>
I'm trying to expose a remote interface to a spring web application, and I'm having issues, always getting 404. What's wrong with my setup below?
Grails:
services - package mypackage
class RemoteUserService implements RemoteUserServiceInterface {
static expose = ['httpinvoker']
User findUser(String userId) {
return User.findByUserId(userId);
}
}
src/groovy/mypackage
class RemoteUserService implements RemoteUserServiceInterface {
static expose = ['httpinvoker']
User findUser(String userId) {
return User.findByUserId(userId);
}
}
Spring:
mypackage
public class MyController extends AbstractController {
RemoteUserServiceInterface remoteUserService
}
appContext
<bean id="viewController" class="mypackage.MyController">
<property name="remoteUserService" ref="remoteUserService"/>
</bean>
<bean id="remoteUserService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
<property name="serviceUrl" value="http://localhost:8080/grails-app-name/httpinvoker/RemoteUserService"/>
<property name="serviceInterface" value="mypackage.RemoteUserServiceInterface"/>
</bean>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要定义
"$controller/$action?/$id?" 的 UrlMapping {}
,否则插件将无法正常工作。
You need to define a UrlMapping of
"$controller/$action?/$id?" {}
or else the plugin won't work correctly.