• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 display image from Database?

 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there a way to display image from Database to JSP directly without placing into any folder.
I can save and retrieve image from database and the place into some folder then display in jsp but I want to display directly from database to jsp.
Any clue ?
 
Ankit Garg
Sheriff
Posts: 9521
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to do this with Struts, then you can use the stream result of Struts 2. You'll have to create an action which will retrieve the image from the database and send it as a stream in the response. In your JSP you'll put the url of that action in the src attribute of img tag...
 
Aaron Raja
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any examples or tutorial on that please?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic