Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Sheriff
Posts: 67650
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic