Unsure if JSTL 1.1 will allow this, but using the Unstandard taglib you
can do:

<un:bind var="bob" type="your.package.Const" field="JVP_LEVEL"/>
<c:if test="$myScopedVar == $bob">
..
</c:if>

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 variable that is in a class?
>
> For example in Const class I have some levels like:
>
> public static final int JVP_LEVEL = 3;
>
> It would be nice if in my JSP I could do (after the import up top)..
>
> <c:if test="${myScopedVar == Const.JVP_LEVEL}" />
>
> I know I could just do ..
>
> <c:if test="${myScopedVar == 3}" />
>
> But it is clearer in the code to use the Constant name. Is it possible
> to do this somehow?
>
> Thanks,
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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

Reply via email to