This is quite a FAQ. The neatest solution propsed was, IMO, the 'bind' tag
in the Jakarta Unstandard taglib
(http://jakarta.apache.org/taglibs/sandbox/doc/unstandard-doc/index.html#bin
d).

I curently use the <c:set> + scriptlet solution you propose.

Paul

> -----Original Message-----
> From: Adam Hardy [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 27, 2004 9:50 PM
> To: Struts Users Mailing List
> Subject: Re: Clean way to obtain a property's value...
> 
> 
> Just before this thread dies, on a closely related note, does anybody 
> have a nice way to get the value of a constant from a static 
> on a class? 
> This is what I don't like:
> 
> <html:select property="resultDisplayTypeId" >
>   <html:options 
> collection="<%=org.gargantus.GargantusLists.ESURVEY_RESULT_DIS
> PLAY_TYPE_LIST 
> %>"
>     property="resultDisplayTypeId"
>     labelProperty="typeName" />
> </html:select>
> 
> I thought of JSTL variables, like:
> <c:set var="resultDisplayTypeListKey">
>    <%=org.gargantus.GargantusLists.ESURVEY_RESULT_DISPLAY_TYPE_LIST %>
> </c:set>
> 
> except somehow avoiding the <% %> tags?
> 
> I thought of instantiating the class and putting in the Application 
> scope and trying to access it like this:
> 
> ${applicationScope.get['myConstantsBean'].resultDisplayTypeId}
> 
> but it's still messy. Does anybody have any better ideas?
> 
> Thanks!
> 
> 
> On 09/27/2004 04:53 PM Paul McCulloch wrote:
> > I think you can achieve what yopu want. For example:
> > 
> > <bean:define id="somevar"><bean:write 
> property="whatever"/></bean:define>
> > 
> > <logic:equal name="somevar" value="one">
> >     I'm some conditional html
> > </logic:equal>
> > 
> > Paul
> > 
> > 
> >>-----Original Message-----
> >>From: Freddy Villalba A. [mailto:[EMAIL PROTECTED]
> >>Sent: Monday, September 27, 2004 3:56 PM
> >>To: 'Struts Users Mailing List'
> >>Subject: RE: Clean way to obtain a property's value...
> >>
> >>
> >>Not sure, Paul... as I understand, <bean:write> directly 
> >>outputs the value.
> >>Therefore, I believe it would work if I wanted to use the value for
> >>conditional (client-side) code (for instance, Javascript), 
> but not for
> >>storing the value in a server-side variable and using it to 
> >>(conditionally)
> >>generate some HTML or other...
> >>
> >>Correct me if I'm wrong, please...
> >>
> >>Regards,
> >>Freddy.
> >>
> >>-----Mensaje original-----
> >>De: Paul McCulloch [mailto:[EMAIL PROTECTED]
> >>Enviado el: lunes, 27 de septiembre de 2004 15:56
> >>Para: 'Struts Users Mailing List'
> >>Asunto: RE: Clean way to obtain a property's value...
> >>
> >>
> >>Doesn't <bean:write> meet your needs?
> >>
> >>As an aside, What is your objection to JSTL?
> >>
> >>Paul.
> 
> -- 
> struts 1.2 + tomcat 5.0.19 + java 1.4.2
> Linux 2.4.20 Debian
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**********************************************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**********************************************************************


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

Reply via email to