Google App Engine - 带有调度程序 Servlet 的 Blob 存储服务
我有一个中央调度程序 servlet,其 servlet 映射为:
当我尝试使用 blob 存储服务的 createUploadUrl("/uploadComplete") 时,它会映射到一个 URL,例如 '/_ah/upload/agp0d2VldG15cGljchsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YEgw'。
在 Blob 存储服务可以处理上传并重定向到 /uploadComplete 之前;我的调度程序 servlet 被调用,因此我无法上传任何内容。
是否有一个 servlet/ 过滤器可以映射到 web.xml 中的 /_ah/upload/* ?
如何避免在 Blob 存储服务执行其操作之前调用调度程序 servlet?
I have a central dispatcher servlet that has a servlet mapping of :
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
When i try to use the blob store service's createUploadUrl("/uploadComplete") it maps to a URL for e.g '/_ah/upload/agp0d2VldG15cGljchsLEhVfX0Jsb2JVcGxvYWRTZXNzaW9uX18YEgw'.
Before the Blob store service can handle the upload and redirect to /uploadComplete; my dispatcher servlet gets called and i am therefore not being able to upload anything.
Is there a servlet/ filter that i can map to /_ah/upload/* in my web.xml ?
How do i avoid the dispatcher servlet from getting called before the Blob store service can do its thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您是否尝试过映射您的 uploadComplete servlet?
我会添加一个映射,例如:
在映射之前
Have you tried mapping your uploadComplete servlet?
I would add a mapping like:
just before your mapping
/_ah/ 下的 URL 由 App Engine 保留,无论您的配置如何,都将被定向到相应的子系统。是什么让您认为请求被发送到您的处理程序而不是 blobstore 处理程序?
URLs under /_ah/ are reserved by App Engine, and will be directed to the appropriate subsystem regardless of what your config says. What makes you think requests are being sent to your handler instead of the blobstore one?
经过进一步调查,我确定处理程序正在被调用,但是请求没有被重写为 DevAppServer 上的“/uploadComplete”。
Blob 被上传到 Blob 存储,但从 Blobstore 服务转发的请求读取 /_ah/upload/...* ,就我的 Web 应用程序端而言,这是一个无效的 URL。
感谢您迄今为止的所有回答。
On further investigation, i have determined that the handler is getting called, however the request is not getting rewritten to "/uploadComplete" on the DevAppServer.
The blobs get uploaded to the blob store, but the forwarded request from the Blobstore service reads /_ah/upload/...* which is an invalid url as far as my end of the web application is concerned.
Thank you for all your answers thus far.