struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cohan, Sean" <SCo...@goSPS.com>
Subject RE: Logic Equals and Interface Constants
Date Sat, 11 Jan 2003 14:12:43 GMT
There are multiple classes that build a collection which is presented on
only one jsp.  For simplicity, I'll refer to constants in the classes and
literals on the one jsp.  Then if the constants change, I only have to
change them in the interface and jsp.

Thanks.

-----Original Message-----
From: dmkarr@earthlink.net [mailto:dmkarr@earthlink.net]
Sent: Friday, January 10, 2003 7:31 PM
To: struts-user@jakarta.apache.org
Subject: Re: Logic Equals and Interface Constants


>>>>> "Sean" == Sean Cohan <Cohan> writes:

    Sean> I'd like to somehow use some final static int's defined in an
interface
    Sean> within <logic:equal> tags.  Something like:

    Sean> <logic:equal name="columnType" value=DeltaItem.LONGTEXT>

    Sean> Can I do this or something like it (e.g., using chars instead of
int's)?

You'll have to use expression scriptlets for the attribute value.  In those
expressions, you can produce any Java expression you want.

If you want/need to avoid scriptlets, then you'd have to use a more involved
process, using Struts-EL, along with a class that uses reflection to load
"static final" constants into a HashMap which can be referenced through the
EL.

-- 
===================================================================
David M. Karr          ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net   ; SCJP; SCWCD




--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message