aspose file tools*
The moose likes JSP and the fly likes Display image in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Display image in jsp" Watch "Display image in jsp" New topic
Author

Display image in jsp

ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
Hai..

my web application in D folder.... but image is in another folder..
how can i retrive and dispaly that image in my Jsp?

thanks
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
JSP is not responsible for displaying an image. JSP is responsible for writing a HTML page to the client browser.

Normal HTML rules apply for getting an image displayed on the page. If you can write a static HTML page that displays that image, then you can write that page with JSP>

Bill
ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
in html can we retrive image from another folder using IMG tag?
akhter wahab
Ranch Hand

Joined: Mar 02, 2009
Posts: 151

ramesh poorella wrote:in html can we retrive image from another folder using IMG tag?


yes you can easily by giving appropriate path


Start Earning Online||Start Earning Using Java
ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
sorry i am not getting image with another folder. in same folder i am getting.............

please give me sample code for that...
akhter wahab
Ranch Hand

Joined: Mar 02, 2009
Posts: 151

ramesh poorella wrote:sorry i am not getting image with another folder. in same folder i am getting.............

please give me sample code for that...


can you provide your code and tell us where folder exist in which image is
ramesh poorella
Ranch Hand

Joined: Jul 19, 2011
Posts: 60
This is my code:




The bar.Jpeg image is in same my application folder..... but i need to retrive and display i mage from separate folder or drive....

please help me
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Take a look at

How can that render an image? You need to fix the URL of the image.
Well as you can see how UseCodeTags helps a lot in viewing as well as understanding the code. I've added them for you.


SCJP, SCWCD.
|Asking Good Questions|
Ashutosh Limaye
Ranch Hand

Joined: Oct 24, 2005
Posts: 58
Change the extention to [img.jpg] .
JPEG is the format type jpg is the file extention.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Display image in jsp