在我的服务器端,我有以下内容:
@ApiOperation(value = "myValue", tags = "{mytag}")
@GET
@Path("mypath")
@Produces("image/jpeg")
public Response getImage(@ApiParam(hidden = true) @HeaderParam("Accept-Language") String acceptLanguage,
@ApiParam(hidden = true) @HeaderParam("accountId") Long accountId,
@PathParam("var1Id") Long var1, @PathParam("imageId") Long documentId,
@PathParam("var2Id") Long var2Id) throws SyncException {
return Response.ok(ImageService.getImage(acceptLanguage, ImageId)).build();
}其中,getImage返回类型为byte[]。
在我的客户端,使用resty GWT,我有以下内容:
@GET
@Path(mypath)
@Produces("image/jpeg")
public void getImage( @PathParam("var1Id") Long var1id, @PathParam("var2Id") Long var2Id , @PathParam("imageId") Long imageId, MethodCallback<T> callback);我的问题是,为了能够使用服务器端发送的byte[],我应该在MethodeCallback中放入什么?
发布于 2018-08-30 16:57:57
对我有效的解决方案是创建一个byteResponse类,其中byte[]数组是一个属性。这个类现在是serverSide中getImage的返回类型,也是gwt端methodeCallback中的类型。
https://stackoverflow.com/questions/51823895
复制相似问题