データベースの画像をJSPで表示する方法
データベースの画像をJSPで表示する方法
<img src="画像用のサーブレットのパス?key=hoge">
slim3+scenic3での方法
□□□□□ JSP □□□□□
${f:h(e.key.name)}
<img src="${f:url(showUrl)}"/>
□□□□□ Java(PageClass) □□□□□
@ActionPath("show/{id}")
public Navigation show(@Var("id") String id) throws Exception {
BlobKey blobKey = new BlobKey(id);
BlobstoreService bs = BlobstoreServiceFactory.getBlobstoreService();
bs.serve(blobKey, response);
return null;
}