File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

How to display image

Prashant Langade
Ranch Hand

Joined: Jul 01, 2009
Posts: 71
Hi

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?

Prashant


[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")

OR

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

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

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to display image
 
Similar Threads
Inserting an Image into the DataBase :
File Path in Mac and Windows
Serlvet to display image - how to prevent client from "Save As Image" ?
Error in displaying image using stream Result
FTP upload