Hassan,
Use the java.io.File.exists() method.  You will also probably have to use
the ServletContext.getRealPath() method to construct the path to the actual
image file.

As a suggestion, I wouldn't recommend putting the images in the jsp
directory.  They should be put in a separate directory.  If you want to
hide them from the public, put them under the WEB-INF directory and have
them be returned by a servlet or else store them as BLOBs in the DB.

Regards,

Richard


At 05:29 PM 11/15/2001 -0400, you wrote:
>My application needs to display pictures of each employee on employee's
>detail page.
>On this page, all the information about employee is coming from database
>except his picture.
>The image files (pictures) are saved where jsp pages are located.
>The picture names are stored as <employee-id>_<last-name>.jpg
>
>So before displaying the picture on the page I would like to check if the
>photo exists in the image directory.
>
>does anyone has done anything like that.
>Please give some suggestions.
>
>Thanks
>Hassan
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to