You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by John Greenhill <jg...@dayspring-tech.com> on 2003/05/02 17:58:36 UTC
Access Constants class with struts tags
Is there a way to use values from a Constants file for comparisons in
logic tags without resorting to scriptlets?
Currently I do this:
<logic:equal name="issueForm" property="period" value="<%=
Constants.PERIOD_WEEKLY %>">
but I'd like to know the scriptlet-free method.
Thanks,
-john
John Greenhill
Dayspring Technologies, Inc.
58 2nd Street, 3rd Floor
San Francisco, CA 94105
Voice: 415.247.9421 ext. 21
Web: www.dayspring-tech.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Access Constants class with struts tags
Posted by Gareth Andrew <ga...@ntlworld.com>.
IMO "scriptlet expressions" (<%= xxx %>) aren't really scriptlets - they
are a kind of gray area necessary to deal with tags that don't have any
expression language support.
The easiest way to remove them is to use a tag library that has
expression langauge support. You options are the struts-el tag
libraries and the JSTL. In both of these
<%=Constants.PERIOD_WEEKLY %>
becomes
${Contants.PERIOD_WEEKLY}
I'm not sure if this helps,
Gareth.
John Greenhill wrote:
>Is there a way to use values from a Constants file for comparisons in
>logic tags without resorting to scriptlets?
>
>Currently I do this:
>
> <logic:equal name="issueForm" property="period" value="<%=
>Constants.PERIOD_WEEKLY %>">
>
>but I'd like to know the scriptlet-free method.
>
>Thanks,
>-john
>
>John Greenhill
>Dayspring Technologies, Inc.
>58 2nd Street, 3rd Floor
>San Francisco, CA 94105
>Voice: 415.247.9421 ext. 21
>Web: www.dayspring-tech.com
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org