• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

images in servlet

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to java servlet. I need an image in a servlet (running Tomcat). It seems to me I have to specify the absolute path for the image before it can be displayed. I tried to put the image under the same directory of the servlet, and it did not work. If I have to put the image under the images directory, how can I use a virtual path?
Thanks.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
specify the complete path of image i.e c:\....
or specify the complete virtual path
i.e. http://localhost:8080/...
usually class files are kept in one folder ..
i don't no which is in terms of tomcat...
store image file on virtual path
http://localhost:8080/imag.jpg
and see if image is coming in ur browser..
Bhupendra
 
reply
    Bookmark Topic Watch Topic
  • New Topic