webservice返回excel表单而不会在客户端下载
我有如下java半调web服务代码
@Path("/todo") public class TodoResource { @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) public Response getfile() { File file =new File("D:\\Test.xls"); // Initialize this to the File path you want to serve. return Response.ok(file, MediaType.APPLICATION_OCTET_STREAM).build(); } }
当我从客户端调用jQuery的Ajax调用的Web服务时,我不想下载这个文件,而只是将文件存储在一些参数,并parsing它。 如何做到这一点?