struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanislaw Findeisen <sf181...@students.mimuw.edu.pl>
Subject IMAGE DISPLAY PROBLEM - PLEASE HELP!! (fwd)
Date Thu, 17 Jul 2003 13:39:35 GMT

Once again, since indentation might be invisible on some clients... Sorry.

---------- Forwarded message ----------


Hello,


I am having a simple problem regarding image displaying in a web 
application (.war).


My directory structure is:

MyWebApp.war
-- META-INF
-- WEB-INF
-- pages
---- graphics
------ MyPicture.gif
---- layout
------ upperBar.jsp


The problem is: HOW to display MyPicture.gif from upperBar.jsp?


I tried this:

        <html:img pageKey="graphics.MyPicture"/>


In properties file I have:

        graphics.MyPicture=/pages/graphics/MyPicture.gif


This works fine -- HTML generated contains this:

        <img src="/MyWebApp/pages/graphics/MyPicture.gif">


Unfortunately, when the browser tries to download the image I get this:

2003-07-17 15:17:05 org.apache.struts.action.RequestProcessor process
INFO: Processing a 'GET' for path '/pages/graphics/MyPicture'
2003-07-17 15:17:05 org.apache.struts.action.RequestProcessor processMapping
SEVERE: Invalid path /pages/graphics/MyPicture was requested


There are two questions arising here:


1). WHERE did the file extension go? Because I get:

        INFO: Processing a 'GET' for path '/pages/graphics/MyPicture'

and not

        INFO: Processing a 'GET' for path '/pages/graphics/MyPicture.gif'


2). WHY doesn't the image get loaded? I tried to refer it in a direct way:

        http://127.0.0.1:7001/MyWebApp/pages/graphics/MyPicture.gif

which of course didn't work either.


I am using Tomcat 4.1.24. My servlet is the 'default' servlet:

        <servlet-mapping>
                <servlet-name>MyWebApp</servlet-name>
                <url-pattern>/</url-pattern>
        </servlet-mapping>



Any help??
THANKS!!



-- Stanislaw Findeisen                  http://rainbow.mimuw.edu.pl/~sf

   Live life to the MAX.
   Follow JESUS.




---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message