Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to retrieve new images uploaded on the server into jsp without restarting the server?  RSS feed

 
Nitish Asgekar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, i have written a jsp to upload images which forwards them to a servlet which in turn stores them in the server and puts a path reference in the database...the prob is i cant view the new images by refreshing the jsp unless i restart the server..
the count of my photos is updated...
the img src for new photos is added but i cant c the photos..it says resource unavailable..
however if i wait for sometime(approx 10 mins) i m able to c the new photo...
how do i view the images without restarting the server or waiting for 10 min???
m using glassfish v3..
please help...
thank you...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you do not need to restart the server. Why would you think that?

How are you serving the images when they are referenced?
 
Nitish Asgekar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:No, you do not need to restart the server. Why would you think that?

How are you serving the images when they are referenced?




i m simply putting the path of the new image in the img src tag..

i thought we need to restart it because i m unable to view the new photos i uploaded unless i restart the server or wait for 10 min.

i m a newbie coder so please bear with me
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should upload images outside of the web context and stream them back to the client (browser) with an image servlet. If you save them to a location in the web context they might be deleted the next time the application is deployed. If you have to "wait 10 minutes" for them to be available then there's probably a GlassFish setting somewhere, but I have no idea what setting could cause that kind of behavior.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!