> -----Original Message-----
> From: Donald Ball [mailto:[EMAIL PROTECTED]]
> 
> hi, i'm trying to figure out how to access static fields or methods
from a
> static class using the jstl el. say i've got a class, call it
> com.example.Foo, which has a method getBar(). how would i access that
> property using jstl el? this doesn't work:
> 
> ${com.example.Foo.bar}
> 
> for, i guess, relatively obvious reasons. any suggestions? this seems
like
> a really stupid question, but i've been poking around for a while and
> can't
> figure out a solution without reverting to scriptlets. thanks.

The JSTL EL can reference javabean properties, maps, and collections.
That's it.  The JSTL specification describes this, although I wish it
had a concise statement to this effect.  You sort of have to figure this
out by deduction.

One curious strategy for accessing static variables would be to create
an object that gets associated with another class, which uses reflection
to load all the "static final" members into a map.  You could then
reference the map entries in the JSTL EL.  Obviously, you would have to
put that created object into one of the available scopes.

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

Reply via email to