struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "j alex" <strutstwou...@gmail.com>
Subject Re: S2 / FTL : Getting application params in FTL
Date Tue, 28 Aug 2007 17:34:18 GMT
It turned out to be as simple as <img
src="${application.GLOBAL_IMAGES_ROOT}/icon.gif">
..thanks to case sensitivity :-) , oops - i just noticed the code i pasted
was messed up but as you would have guessed it was a typo

On 8/28/07, Laurie Harper <laurie@holoweb.net> wrote:
>
> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message