If you want to use constant fields, check out the archives for this
list...There have been some good posts in the last couple of weeks on how
to accomplish this...JSTL does not provide a mechanism for retrieving
constant values from classes...Of course, there is a tag for it in the
unstandard library...But something about an unstandard library as part of
a standard library just gives me a headache...So, I would stay away from
that and use solutions based on the J2EE spec...

Since you're using Struts, the application resources file is a good place
to stick constant values as well...

On Sat, 26 Jul 2003, Vincent Peytavin wrote:

> 
> ----- Original Message -----
> From: "David M. Karr" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, July 26, 2003 8:10 AM
> Subject: Re: <c:forEach items="${<%=CONSTANT.MY_C%>}"...
> 
> 
> > >>>>> "Vincent" == Vincent Peytavin <[EMAIL PROTECTED]>
> writes:
> > If you need to reference constant values, you can have
> > your Action or Servlet code put your constants into a bean in some scope.
> This
> > particular issue has been discussed numerous times on this list.
> 
> Well, I change my question to this one :
> when you have stg like that <c:forEach var="my_device"
> items="${devices_list}"
> 
> varStatus="index_device">
> it means that in your Action (suppose you use struts) you do a
> session.setAttribute("devices_list", listDevices).
> 
> But I'd like to do the same thing by placing the listDevices bean under a
> key specified by
> Constants.DEVICES_LIST_KEY.
> (in Constants class : public static final String DEVICES_LIST_KEY =
> "devices_list"; )
> session.setAttribute(Constants.DEVICES_LIST_KEY, listDevices)
> How to use this session bean with c:forEach ?
> 
> Isn't it a good way to do this kind of thing? I'm newbie with struts/Tag
> Libraries and so, i'm waiting for you advice and website documentation.
> 
> Thanks for your help!
> 
> --
> Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-------------------
Eric Hauser
[EMAIL PROTECTED]
(317) 679-4766


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

Reply via email to