wood burning stoves 2.0*
The moose likes JSP and the fly likes Display Image Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Display Image Problem" Watch "Display Image Problem" New topic
Author

Display Image Problem

Rajshekhar Anand
Greenhorn

Joined: May 22, 2008
Posts: 14
Hi All ,

I have directory structure for my war file deployed in tomcat as below:

ProjName
-Index.jsp
-images
----a1.gif
----a2.gif
-web-inf
----web.xml


When I try to access the image
http://localhost:8080/ProjName/images/a1.gif -> I am able to see the image in browser

but when I try for
http://localhost:8080/ProjName/images/a2.gif -> This doesn't works.


Any Idea , what can be the issue.

When I use these images inside my index.jsp , I can't see the image a2.gif , but I can see a1.gif.



-Gaurav

[ November 26, 2008: Message edited by: Gaurav Sinha ]
[ November 26, 2008: Message edited by: Gaurav Sinha ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41106
    
  45
Are the permissions on that file set correctly so that it is world-readable?


Ping & DNS - my free Android networking tools app
Duc Vo
Ranch Hand

Joined: Nov 20, 2008
Posts: 254
QUestions:
(1) How big are the images?
(2) What server are you using? Can you enable trace log to see if the two images are actually sent?
(3) Is there any filter in the web.xml filtering on *.gif?


“Everything should be as simple as it is, but not simpler.” Albert Einstein
Rajshekhar Anand
Greenhorn

Joined: May 22, 2008
Posts: 14
@Ulf Dittmer

world-readable permission mean ?
when I check properties for both files , they are same .
not checked for readonly permission.


@Duc Vo
images are in KB . 2.19KB
how to enable trace log . I will try to find , how to do it.
no there is no rule set for *.gif in web.xml

when I get the source of rendered jsp , from browser , save it as html . and then open it with browser , it works fine.
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
If your browser allows you to browse through the directory what do you see when you put this link? Do you see two .gif files?

http://localhost:8080/ProjName/images/

If at all you see two files, then click on this a2.gif file.
Does it show the image you require? If yes, what url do you see in the address bar? Does it contain something like "%20". i just want to confirm if there are no spaces in the name.
[ November 27, 2008: Message edited by: Amol Nayak ]
Srikanth Nutigattu
Ranch Hand

Joined: Oct 30, 2007
Posts: 114
it may sound stupid! but check if you are using the correct "file Name" and also spelling mistakes in the URL's.
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
Can you share with us what the exact problem was and what was done to solve that?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Display Image Problem
 
Similar Threads
HTTP Status 500 - No Context configured to process this request
How access web application use root context?
how to change the URL
sendRedirect problem
Tomcat question