• Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying Image

 
siva ravipati
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i retrieve the image from database ,it overrides the existing jsp page and loads the image when i use response object
how i display the image in my current jsp with existing fields are not overridden.
[ December 12, 2008: Message edited by: siva ravipati ]
 
Manuel Leiria
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can retrieve the image from the database, save it in a temp dir and in your jsp just put an html img tag pointing to your image location.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rather create a servlet which gets the image from DB as InputStream and writes it to the OutputStream of the HttpServletResponse. Finally invoke that servlet in the <img> tag along with some unique identifier as request parameter so that it knows which image to get from the DB.
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By using above method images get displayed only on local page not on the others machines.

Provide a good solution.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you're doing it the wrong way. Hard to say without any details about the problem.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
chetan dhumane wrote:By using above method images get displayed only on local page not on the others machines.

Provide a good solution.

Hogwash. I use that technique all the time.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!