How to get HttpServletResponse object in restlet for GAE BlobStore serve

可紊 提交于 2019-12-08 03:02:22

问题


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?


回答1:


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);

and similar for the response :

org.restlet.Request restletResponse = getResponse();
HttpServletResponse servletResponse = ServletUtils.getResponse(restletResponse);


来源:https://stackoverflow.com/questions/15615450/how-to-get-httpservletresponse-object-in-restlet-for-gae-blobstore-serve

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!