问题描述
我想知道是否可以使用Sitebricks托管Google App Engine后端servlet。我想在我的GAE Java应用程序中这样做 - 前端使用GAE的 BackendService
接口获取后端URL并发送HTTP请求 - 但HTTP响应始终返回 404找不到)。
我很想发布一些源代码/配置文件,但我认为这对我来说可能是最好的解释我在做什么。基本上,我的servlet使用Sitebricks进行配置,方式与我的前端servlet完全一样(即使用 @Service
, @在servlet类和方法中
和 @Get
批注中,以及在我的配置文件 SitebricksModule
中app的全局Guice Injector
实例)。我正在使用在 backends.xml 中正确配置的动态后端实例。
有没有人对配对 Sitebricks strong>与 GAE后端?
是Sitebricks适用于GAE。我推荐Sonatype的OSS回购的0.8.8-SNAPSHOT版本用于最新功能。否则,Maven Central最新的测试版本是0.8.7。唯一不起作用的是使用Sitebricks Web客户端从GAE请求其他网站。
您是否使用GuiceServletContextListener?这是创建注射器的最佳方法。还要确保你的web.xml指向它并正确设置GuiceFilter(按照sitebricks.org文档)。
Dhanji。
(维护者,sitebricks)
I would like to know whether it is possible to host a Google App Engine backend servlet using Sitebricks. I am trying to do so in my GAE Java app -- frontend gets the backend URL using GAE's BackendService
interface and send an HTTP Request -- but the HTTP response always returns with a 404 Not Found).
I would love to post some source code / configuration files, but I fell that it may be best for me to explain what I am doing. Basically, my servlet has been configured using Sitebricks in the same exact manner as my frontend servlets that are working perfectly (ie, using the @Service
, @At
and @Get
annotation in the servlet classes and methods, plus configuring SitebricksModule
in my app's global Guice Injector
instance). I am using a dynamic backend instance, configured properly in backends.xml.
Does anyone have any hints on pairing Sitebricks with GAE Backends?
Yes Sitebricks works on GAE. I recommend the 0.8.8-SNAPSHOT version from sonatype's OSS repo for latest functionality. Otherwise the latest tested release is 0.8.7 from Maven Central. The only bit that doesn't work is requesting other websites from GAE using the Sitebricks Web Client.
Are you using GuiceServletContextListener? This is the best way to create an Injector. Also make sure your web.xml points to it and sets up GuiceFilter correctly (as per sitebricks.org docs).
Dhanji.(maintainer, sitebricks)
这篇关于Sitebricks与GAE后端兼容(Java)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!