2016-08-15 6 views
0

Blob 저장소와 구글 SPI의 AppEngine에 엔드 포인트가 : 8080/_ah/API/탐색기 구글 탐험 : 을 나는자바 내가 로컬 호스트를 사용하고

{ 
"error": { 
    "message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletResponse, problem: abstract types can only be instantiated with additional type information\n at [Source: N/A; line: -1, column: -1]", 
    "code": 400, 
    "errors": [ 
    { 
    "domain": "global", 
    "reason": "badRequest", 
    "message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletResponse, problem: abstract types can only be instantiated with additional type information\n at [Source: N/A; line: -1, column: -1]" 
    } 
    ] 
} 

내 Google SPI 코드가 계속 것은 :

@ApiMethod(name = "findBillImage", httpMethod = ApiMethod.HttpMethod.GET) 
public void findImage(HttpServletResponse httpServletResponse , @Named("blobkey") String blobKeyValue) throws IOException { 
    BlobKey blobKey = new BlobKey(blobKeyValue); 
    BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();   
    blobstoreService.serve(blobKey, httpServletResponse);  
} 

언제 내가 HttpServletResponse HttpServletResponse에 무엇을 쓰려고 시도 .. 내가 httpServletResponse에 쓸 수없는 이유에 대해 잃어버린 메신저

답변

0

Soooo .. swer는 내 경우에는 실제로 '디자인'입니다.

Google 애플릿 엔진으로 "REST"를 구현 중이므로 "이미지"를 반환하도록 HttpResponse를 수정해서는 안됩니다.

그래서 HttpResponse로 이미지를 "검색"하는 것은 이상적이지 않습니다. 나는 클라이언트에 저장 URL로 직접 이미지를 노출한다 :

https://storage.cloud.google.com/myapp.appspot.com/20160603_154924.jpg 

나는이 대답 LIKE '100 %',하지만 난 읽고있다 것과 내가이 올바른 생각 말할 수 없습니다.

관련 문제