File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to display image Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to display image" Watch "How to display image" New topic

How to display image

Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 73

I have a problem while displaying a image in excel sheet.

I can see the image getting displayed when i use

but if i want to access/display that image using the context path like

I am not able to see that image getting displayed.

"WebDnldCtr" is the name of the project(main folder) which has "WebContent" folder which in turn has "Common" folder which contains "conf_en_US.gif" image.

Attaching herewith the snapshot of the image.

Can any one please help me?


[Thumbnail for Problem.JPG]

Mani Venkata Kanth
Ranch Hand

Joined: Aug 21, 2006
Posts: 39
FileInputStream looks for exact file location like,

FileInputStream fis=new FileInputStream("C:/RAD7-0-projects/WebDnldCtr/WebDnldCtr/WebContent/Common/conf_en_US.gif")


If your current logic file in WebDnldCtr folder, you can write like

FileInputStream fis=new FileInputStream("./WebDnldCtr/WebContent/Common/conf_en_US.gif")

I agree. Here's the link:
subject: How to display image
It's not a secret anymore!