本文介绍了如何获取用于GAE BlobStore服务的restlet中的HttpServletResponse对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在GAE中使用Restlet,GAE Blobstore API需要一个HttpServletRequest对象来上传blob和一个HttpServletResponse对象来提供服务。有没有办法从Restlet Response获取HttpServletResponse对象?
I'm using Restlet with GAE, and the GAE Blobstore API requires a HttpServletRequest object for uploading blobs and a HttpServletResponse object for serving them. Is there any way to get the HttpServletResponse object from the restlet Response?
推荐答案
您可以使用实用工具类org.restlet.ext .servlet.ServletUtils到达HttpServletRequest:
You can use the utility class org.restlet.ext.servlet.ServletUtils to get to the HttpServletRequest :
org.restlet.Request restletRequest = getRequest();
HttpServletRequest servletRequest = ServletUtils.getRequest(restletRequest);
以及类似的响应:
org.restlet.Request restletResponse = getResponse();
HttpServletResponse servletResponse = ServletUtils.getResponse(restletResponse);
这篇关于如何获取用于GAE BlobStore服务的restlet中的HttpServletResponse对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!