Results 1 to 4 of 4
  1. #1
    aali-01 is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default displaying images that are out side the scope of web/application server.

    hey guys,
    i am developing a website for pictures. now that problem that i am facing is that i have images in C drive of my windows PC. now i want those images to be displayed on my jsp pages. is it possible to do that ?
    is it possible to implement a servlet that would write the images to jsp pages ?

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

    Default

    Have a servlet which serves the image file, reading the file, outputting the appropriate header for an image, then writing the image out (lots of tutorials online for how to do this). In the jsp page, just use a basic html img tag to link to the image. Note that if you are reading (and outputting) the contents of files on you hard drive, I'd recommend some security filter to prevent someone from doing so with files other than the image files you want to display

  3. #3
    aali-01 is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default

    thanks alot bro. can u tell me a link for the tutorial ? i googled it but no luck

  4. #4
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    7

Similar Threads

  1. forward request url from server side
    By ragavendran in forum Java Servlet
    Replies: 1
    Last Post: 11-30-2010, 03:28 PM
  2. Put hashmap in application scope ?
    By Narendra_ipace in forum Advanced Java
    Replies: 1
    Last Post: 11-23-2010, 07:56 AM
  3. how to countdown on server side
    By BigBear in forum Java Servlet
    Replies: 3
    Last Post: 04-26-2010, 10:33 PM
  4. Replies: 1
    Last Post: 03-20-2010, 07:03 PM
  5. Replies: 9
    Last Post: 09-01-2009, 07:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •