>>>>> "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).

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP



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

Reply via email to