Yeah, the topic has come up. It could be done in principle, but

 - it won't make it into JSTL 1.0

 - there are problems with referring to static members of a class
   The JSTL EL just refers to objects, so it's not clear which class in
   the object's ancestry hierarchy the static values would come from.  
   We'd probably need to add a mechanism to refer to a class specifically,
   and this would complicate a language that's intended to hide the
   details of Java data types for page authors.

Hope that helps,

-- 
Shawn Bayern
Author, "JSP Standard Tag Library"  http://www.jstlbook.com
(coming this summer from Manning Publications)

On Mon, 15 Apr 2002, Borislav Iordanov wrote:

> Hi,
> 
> It would be useful if the JSTL expression language supported enum 
> constants access through the '.' operator. For example:
> 
> class A
> {
>    public final static int  ENUM_1 = 0;
>    public final static int ENUM_2 = 1;
> 
>   public int getType() // returns one of ENUM_1, ENUM_2 etc...
> }
> 
> 
> and then
> 
> <c:choose>
>    <c:when test="${a.type == a.ENUM_1}">
>     do something
>   </c:when>
>    <c:when test="${a.type == a.ENUM_2}">
>     do something else
>   </c:when>
> </c:choose>
> 
> Could it be done?
> Thanks,
> Boris
>    
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


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

Reply via email to