Re: Clean way to obtain a property's value...

2004-10-11 Thread Axel Gross
some ideas
- get a singleton instance of GargantusLists and call it 'ns' (for
namespace) then you just have to use
ns.ESURVEY_RESULT_DISPLAY_TYPE_LIST
- make a stupid tld in which you define those constants
- use jakarta jexl or another expression language which allows more than jsp2.0 EL

hth,
axel

On 2004-09-27 at 21:50:26 +0100, Adam Hardy wrote:
> 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:
> 
> 
>   collection="<%=org.gargantus.GargantusLists.ESURVEY_RESULT_DISPLAY_TYPE_LIST 
> %>"
>property="resultDisplayTypeId"
>labelProperty="typeName" />
> 
> 
> I thought of JSTL variables, like:
> 
>   <%=org.gargantus.GargantusLists.ESURVEY_RESULT_DISPLAY_TYPE_LIST %>
> 
> 
> 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:
> >
> >
> >
> >
> > I'm some conditional html
> >
> >
> >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,  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  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]
> 
> 

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



Re: Struts usage question

2004-12-31 Thread Axel Gross
hi there!

the el libs use the jsp 2.0 expression language (${} instead of <%= %> )
If you don't have a servlet container which supports that by itself, you can
use the el-tags to use it at least inside of the struts tags.

hth,
axel

On 2004-12-31 at 13:23:19 +0200, dsarris wrote:
> On Fri, 31 Dec 2004 11:26:47 +0200, dsarris <[EMAIL PROTECTED]> wrote:
> > On Thu, 30 Dec 2004 09:23:28 -0700, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > > From: "dsarris" <[EMAIL PROTECTED]>
> > > > I am trying to use the  tag with the
> > > >  tag.
> > > > Do I have to put the collection property inside the form bean of the
> > > > form that contains the ?
> > >
> > > The docs say if you leave off the 'name' attribute, the framework will 
> > > look
> > > to the enclosing form bean.  So use 'name' to tell it which bean to use.
> > >
> > > Is there a reason to use  over  > > collection="..."> ?  Just curious, I use the second one:
> > >
> > > 
> > >  > > labelProperty="value"/>
> > > 
> > > (Where contactTypes is a Map sitting in Application scope.)
> > >
> > > --
> > > Wendy Smoak
> > 
> > I managed to fixed it using the name attribute. Thank you.
> > 
> > However, where is a distribution of the strus-el library? I am using
> > struts 1.2.4 and I have not found it!
> > Why is better to use the struts-el?
> > 
> > --
> > Dimitris Sarris
> > 
> I found them in the contrib directory ;-). 
> However, I have not found documentation regarding the struts-el extention yet.
> 
> -
> 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]