java - How to display image in Struts 2? -


i need retrieve rows in database image saved in byte array. how display image using strut2?

i have displayed using custom result. passed id , make action search in database. problem how invoke several times? have action retrieve rows. how call display image action list action? or there better way achieve this?

java

my action has list of objects want show on jsp.

jsp

first way: use iterator tag , on each iteration want display image in byte array. want call action retrieve image here.

second way: tried post , not working me.

<img src="data:image/jpg;base64, <s:property value="imagedata"></s:property> />" > 

image data image in string.

to retrieve rows in database there's many ways of them utilize jdbc api. can map object image array containing bytes or blob or clob data persist in database.

displaying images required send browser. in struts2 there's stream result type used output image data browser.

or use servlet api transmit data on jsp similar in how send , display image action class jsp in struts 2 answer.

combining experience answers enlighten in question stringify data may achieve suitable results.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -