You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by John C Cartwright <Jo...@noaa.gov> on 2003/11/20 17:07:43 UTC
Accessing properties
Hello All,
I'm trying to use the value of a property in a <c:if test=""> element.
I have the Properties object in application scope, but I can't seem to
figure out how (of if) I can address the individual property value of a
given key. Something like props.get("viewer.tool.useZoomIn") in a
scriptlet.
I thought about transfering the properties to a HashMap, but given the
"."s embeded in the property keys, wasn't sure how I'd access them even
then.
Thanks for any help or suggestions!
-- john
=====================================================
John Cartwright
Associate Scientist
Geospatial Data Services Group
CIRES, National Geophysical Data Center/NOAA
(303) 497-6284
John.C.Cartwright@noaa.gov
=====================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Accessing properties
Posted by Kris Schneider <kr...@dotech.com>.
Right. It's easy to forget (or to never have looked), but Properties extends
Hashtable which implements Map...
Quoting "K.C. Baltz" <kc...@lollimail.com>:
> I'm not sure if EL handles properties, but if it's going to work like a
> HashMap, it'll look like this:
>
> ${applicationScope.props["viewer.tool.useZoomIn"]}
>
> That should get around the problem of the "."s in the name.
>
> K.C.
>
> John C Cartwright wrote:
>
> > Hello All,
> >
> > I'm trying to use the value of a property in a <c:if test=""> element.
> >
> > I have the Properties object in application scope, but I can't seem to
> > figure out how (of if) I can address the individual property value of
> > a given key. Something like props.get("viewer.tool.useZoomIn") in a
> > scriptlet.
> >
> > I thought about transfering the properties to a HashMap, but given the
> > "."s embeded in the property keys, wasn't sure how I'd access them
> > even then.
> >
> > Thanks for any help or suggestions!
> >
> >
> > -- john
> >
> >
> > =====================================================
> > John Cartwright
> > Associate Scientist
> > Geospatial Data Services Group
> > CIRES, National Geophysical Data Center/NOAA
> > (303) 497-6284
> > John.C.Cartwright@noaa.gov
> > =====================================================
--
Kris Schneider <ma...@dotech.com>
D.O.Tech <http://www.dotech.com/>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
Re: Accessing properties
Posted by "K.C. Baltz" <kc...@lollimail.com>.
I'm not sure if EL handles properties, but if it's going to work like a
HashMap, it'll look like this:
${applicationScope.props["viewer.tool.useZoomIn"]}
That should get around the problem of the "."s in the name.
K.C.
John C Cartwright wrote:
> Hello All,
>
> I'm trying to use the value of a property in a <c:if test=""> element.
>
> I have the Properties object in application scope, but I can't seem to
> figure out how (of if) I can address the individual property value of
> a given key. Something like props.get("viewer.tool.useZoomIn") in a
> scriptlet.
>
> I thought about transfering the properties to a HashMap, but given the
> "."s embeded in the property keys, wasn't sure how I'd access them
> even then.
>
> Thanks for any help or suggestions!
>
>
> -- john
>
>
> =====================================================
> John Cartwright
> Associate Scientist
> Geospatial Data Services Group
> CIRES, National Geophysical Data Center/NOAA
> (303) 497-6284
> John.C.Cartwright@noaa.gov
> =====================================================
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org