Results 1 to 6 of 6
Thread: Unable to display gif image
- 05-06-2011, 07:14 AM #1
Member
- Join Date
- Sep 2010
- Posts
- 12
- Rep Power
- 0
Unable to display gif image
I want to display an animated gif image in my JSP page .
I wrote the code like ,
<div id="loginright"><img src="../image/loading.gif" /></div>
When I open the JSP page in browser , only a " x mark " gets displayed .
When I use,
<div id="loginright"><img src="../image/loading.jpg" /></div>
it works fine .
Please help me to add gif image in jsp page ...
Browser Used: ie 8
- 05-06-2011, 08:22 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Nothing to do with JSPs.
That gif image is not where you think it is.
Do a simple HTML page which just shows those two images (gif and png), since HTML is all the browser is going to see.
- 05-09-2011, 06:07 AM #3
Member
- Join Date
- Sep 2010
- Posts
- 12
- Rep Power
- 0
Thanks ! Both the images (gif & jpg) are getting displayed in the sample HTML page but when I use the same in jsp , only the " X Mark " gets displayed . I can able to get the path of the image by right clicking the "X Mark" .
- 05-09-2011, 09:25 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
And you've checked that the resultant HTML from the JSP is the same as the plain HTML you are checking against?
Post them both here.
- 05-09-2011, 10:37 AM #5
Member
- Join Date
- Sep 2010
- Posts
- 12
- Rep Power
- 0
I have just right clicked my jsp diplayed & viewed HTML source in browser as follows,
(Gif image is not displayed)
(JPG gets displayed)Java Code:<div id="page"> <div id="logo"><img src="../image/logo.gif" alt="Welcome" /></div> <div style="margin-left: 430px; margin-top: 120px;width=300" ><font color="red"><b></b> </font></div>
Sample HTML Page (gif works fine with it) :Java Code:<div id="page"> <div id="logo"><img src="../image/logo.jpg" alt="Welcome" /></div> <div style="margin-left: 430px; margin-top: 120px;width=300" ><font color="red"><b></b> </font></div>
Java Code:<div id="page"> <div id="logo"><img src="C:\image\logo.gif" alt="Welcome" /></div> <div style="margin-left: 430px; margin-top: 120px;width=300" > </div> </div>
The jsp page contains more lines of code , so I'm unable to post the complete code !
- 05-09-2011, 10:43 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
That HTML is not the same as that of the JSP.
So it's not actually a test.
Write an html page, deployed on the same site as your JSP page, with the same HTML code in it. I'll guarantee it doesn't work either. Your browser has no idea that that HTML has come from a JSP.
In other words, there is no logo.gif file located in the same place as the logo.jpg file that is being displayed.
Similar Threads
-
image display
By asmitarnd in forum AWT / SwingReplies: 3Last Post: 04-07-2011, 11:17 AM -
Unable to set image as background
By MrPremium in forum New To JavaReplies: 1Last Post: 04-01-2011, 01:00 AM -
Unable to load an image on JPanel
By shanthi in forum Java AppletsReplies: 1Last Post: 02-28-2011, 04:55 PM -
Unable to display JDialog from JFrame
By jv5 in forum NetBeansReplies: 2Last Post: 02-04-2009, 04:33 AM -
Unable to draw buffered image
By pedjasmek in forum Java 2DReplies: 7Last Post: 08-08-2008, 03:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks