BlobStore 重定向被 ServletModule 有线 servlet 忽略
在 blobstore 处理文件的上传请求后,它会重定向到给定的 url,在本例中为“/upload”。如果我在 web.xml 中配置 UploadServlet url,如下所示:
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.....servlet.UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/upload</url-pattern>
</servlet-mapping>
它可以工作。如果我使用 Guice 连接 servlet:
serve("/upload").with(UploadServlet.class);
我收到错误:
Problem accessing /upload. Reason:NOT_FOUND
似乎 com.google.inject.servlet.ServletModule 不处理重定向。有办法解决这个问题吗?
After the blobstore handles the upload request of a file it redirects to the url it is given, in this case "/upload". If I configure the UploadServlet url in web.xml like this:
<servlet>
<servlet-name>uploadServlet</servlet-name>
<servlet-class>com.....servlet.UploadServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>uploadServlet</servlet-name>
<url-pattern>/upload</url-pattern>
</servlet-mapping>
It works. If I use Guice to wire the servlet:
serve("/upload").with(UploadServlet.class);
I get the error:
Problem accessing /upload. Reason:NOT_FOUND
It seems as though the com.google.inject.servlet.ServletModule does not handle redirects. Is there a way around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
今天我自己也遇到了同样的问题。这解决了我的问题,并且可能相关:
https://groups。 google.com/forum/#!topic/google-appengine-java/oqfvEmZGrdw
当然,对你来说可能为时已晚,但对其他人来说可能会有所帮助:-)
I have struggled with the same issue myself today. This solved my problem and may be related:
https://groups.google.com/forum/#!topic/google-appengine-java/oqfvEmZGrdw
Of course, may be too late for you but for others it might help :-)