繁体   English   中英

如何从Google App Engine(Java)将图像检索到JSP中

[英]How to retrieve image into the jsp from the google app engine(java)

我正在寻找将图像导入到jsp中。

我找到了此链接

但是在这种情况下,我无法将图像还原为所需的jsp,它只是显示图像

我建议您将Blobstore中的图像作为图像服务来提供,它将为您的图像提供更好的性能,尺寸等。

请参阅下面的代码。

ImagesService services = ImagesServiceFactory.getImagesService();
ServingUrlOptions serve = ServingUrlOptions.Builder.withBlobKey(blobKey);    // Blobkey of the image uploaded to BlobStore.
String url = services.getServingUrl(serve);

您将获得图像的URL,可以将其轻松放入HTML的Image标签中。

<img src="url" />

您可以从这里进一步了解AppEngine的图像服务。 GAE影像服务

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM