RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Rick Reumann
On Tue, 2003-07-22 at 12:41, Kris Schneider wrote: > public static Map getConstantFieldsAsMap(Class cls) > throws IllegalAccessException { > Field[] allFields = cls.getDeclaredFields(); > int numFields = allFields.length; > Map propMap = new HashMap(numFields); >

RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Rick Reumann
On Tue, 2003-07-22 at 12:13, Karr, David wrote: > > So for every constant value that you want to use, in every JSP page, > you're going to have a call to the "bind" tag from the unstandard > library? This is as opposed to a single block of code in a servlet to > load the constants into a bean a

RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Kris Schneider
I think I've posted this before, either here or in struts-user. At app startup, process the classes you need and store each in application scope using their class names as keys (or whatever makes the most sense to you). public static Map getConstantFieldsAsMap(Class cls) throws IllegalAc

RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Karr, David
> -Original Message- > From: Rick Reumann [mailto:[EMAIL PROTECTED] > > On Tue, 2003-07-22 at 10:54, Karr, David wrote: > > > If you have a bunch of constants that you might want to reference, you > > might consider processing a class with reflection, loading all the > > "static final" va

RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Rick Reumann
On Tue, 2003-07-22 at 10:54, Karr, David wrote: > If you have a bunch of constants that you might want to reference, you > might consider processing a class with reflection, loading all the > "static final" variables into a hashmap, keyed by the variable name. > The resulting references in your J

Re: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Rick Reumann
On Tue, 2003-07-22 at 10:52, Henri Yandell wrote: > Unsure if JSTL 1.1 will allow this, but using the Unstandard taglib you > can do: > > > > .. > > > http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/intro.html Killer! I'll have to check this out right now. -- Rick -

RE: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Karr, David
The pre-JSP 2.0 version of the JSTL can reference properties of JavaBeans, and entries of collections and maps. That's it. If you have a bunch of constants that you might want to reference, you might consider processing a class with reflection, loading all the "static final" variables into a hash

Re: Way to compare scoped value to a class constant variable?

2003-07-22 Thread Henri Yandell
Unsure if JSTL 1.1 will allow this, but using the Unstandard taglib you can do: .. http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/intro.html Hen On 22 Jul 2003, Rick Reumann wrote: > I'm wondering if there is a way I could compare a scoped variable to a > static constant vari