struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: S2 / FTL : Getting application params in FTL
Date Tue, 28 Aug 2007 17:27:57 GMT
j alex wrote:
> Hi,
> 
> How do i access params defined in web.xml in the FTL ? ; In my app, all the
> images are located at a particular path which is defined as
> 
>     <context-param>
>         <param-name>GLOBAL_IMAGES_ROOT</param-name>
>         <param-value>www/abc/def/images</param-value>
>     </context-param>
> 
> and i want to show an icon from this directory within the FTL . How would i
> make GLOBAL_IMAGES_ROOT available to the FTL markup?
> 
> <img src="${Application.LOCAL_JS_ROOT}/icon.gif"> does not work

You'll need to have some code somewhere to copy the context parameters 
defined in web.xml into application scope. Servlet context parameters 
aren't automatically put anywhere accessible via OGNL.

Also, it'd help to use the same name when defining and accessing the 
constant ;-)

L.


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


Mime
View raw message