If these are constants in your application, you want to load this information ONCE, 
into your application context.  You would do this in a servlet's init() method, which 
is set to "load-on-startup", or you could add a ServletContextListener for the 
application to do the same thing.

> -----Original Message-----
> From: Affan Qureshi [mailto:[EMAIL PROTECTED]]
> 
> Or I could have a jsp page that set pageContext variables 
> with the constant
> values. I can include that page in all JSPs where i need 
> constant values.
> And then I could use those pageContext variables in EL tags.
> 
> ----- Original Message -----
> From: "David M. Karr" <[EMAIL PROTECTED]>
> 
> > >>>>> "Affan" == Affan Qureshi <[EMAIL PROTECTED]> writes:
> >
> >     Affan> I want to do a test like this:
> >     Affan> <c:if test="${parameter.type == <%= 
> ParameterBean.TEXT%>}">
> >     Affan>     <nested:text property="value" />
> >     Affan> </c:if>
> >
> >     Affan> I am comparing a value against a constant in a 
> class but I
> can't execute a
> >     Affan> RT expression in a <c:if > when using the EL 
> tags. How do I
> accomplish this
> >     Affan> in EL?
> >
> >     Affan> Of course I can initialize pageContext variables 
> with all the
> constants and
> >     Affan> do EL comparisons using them. But is there 
> another way to do
> this?
> >
> > The EL only references javabean properties.  That's what 
> you have to work
> with.
> >
> > Write a function which takes a class and a hashmap, and 
> uses reflection to
> > populate all the constant symbols into the hashmap.  You can then
> reference
> > that hashmap in the EL.  Either that, or use both the "c" 
> and "c-rt" tags,
> and
> > use "c-rt:set" to set a scoped attribute and then "c:if" (I 
> think that
> would
> > work).

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

Reply via email to