As your serlvet-mapping is setted to "<url-pattern>/</url-pattern>" every request is 
handled by Struts.

Struts RequestProcessor extracts the extension to get the action path to process.
request = "/MyWebApp/pages/graphics/MyPicture.gif"

When your request is handled, they're is no action-mapping for
"/MyWebApp/pages/graphics/MyPicture"


You should use ".do" url-pattern for Struts actions, so that other types are directly 
handled by HTTP server (or
container)

Nico.


>
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to