I though about using curly braces as well. What stopped me using them was
the possible conflict with MessageFormat arguments. It may not be a strong
argument, but I still preferred using another pair of symbols. The other
reason is because when accessing a Map you call a method and use normal
brackets, so I though I would keep the simple idea of [] for arrays and ()
for maps (even though the semantic is different, one being a real index, and
the other a method call). This is actually more or less what you advocate by
saying ()=method call, isn't it?

I'd love to see this extension incorporated into the commons as well. I
think it would just take a few developers/committers supporting this idea.

Any other opinion on both of these topics (standardization + integration)?

Fr.

-----Original Message-----
From: Immanuel, Gidado-Yisa [mailto:[EMAIL PROTECTED]]
Sent: 29 June 2001 18:01
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: String indexing in beans (was: Global values as Tag
parameters... .How???)


For Rey's extensions to PropertyUtils, if I want to traverse my
bean-object, I should be able to do something like this:

     property="report.matrix(Accounts).column(DateCreated).row[1]"

Rey's extension is great.  I would suggest however, replacing
the '(' and ')' parenthesis with curly braces: '{' & '}'.  Just
because, I tend to think:

     () - method/function
     [] - array index
     {} - perl-style hash-association

My question to the community is, "Can we standardise" on the
convention for string indexing (namely, with regards to delimiters),
so that when some of these extensions find there way into tag
hanlders like bean:write and bean:define, there will not be
any backward compatibility issues?

On a related note, any idea what it would take to get extensions
such as these incorporated into JakartaCommons.BeanUtils?  I'm
assuming that Struts will be using the JakartaCommons.BeanUtils
as soon as it becomes available; any clarification on this would
be helpful.

Thanks,
Gidado

-----Original Message-----
From: Rey Francois [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 27, 2001 2:48 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Global values as Tag parameters....How???


I have extended the PropertyUtils so that it can support as well what we
call 'string keyed' properties. It's part of the mapper framework I made
publicly available recently (
http://www.husted.com/about/struts/resources.htm#extensions
<http://www.husted.com/about/struts/resources.htm#extensions> ).
Have  look at it and you may be able to do what you want.
 
Fr.

-----Original Message-----
From: Calvin Yu [mailto:[EMAIL PROTECTED]]
Sent: 27 June 2001 20:51
To: [EMAIL PROTECTED]; Jonathan
Subject: Re: Global values as Tag parameters....How???



I imagine you'll have to parse that attribute yourself and use reflection to
get that value.  I don't think Struts has support for this.  It might be
difficult to keep it generic however, since I don't think there is way you
can access the imports that are declared in a JSP page.
 
Of course, there's always this:
 
<html:userTargetedMessages messagesObjectKey="<%= Globals.MESSAGES_OBJECT
%>"/>
 
Calvin

----- Original Message ----- 
From: Jonathan <mailto:[EMAIL PROTECTED]>  
To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>  
Sent: Wednesday, June 27, 2001 10:03 AM
Subject: Global values as Tag parameters....How???

I am creating a custom Struts tag which needs to search for an object in a
HashMap.  I want the 'key" for the object in the HashMap to be some agreed
upon, pre-defined, final global value defined in a file available to the
whole application.  How do I refer to this value in a Tag attribute?
 
eg.
<html:userTargetedMessages messagesObjectKey="Globals.MESSAGES_OBJECT"/>
 
where "Globals.MESSAGES_OBJECT" is some static final variable in a file


************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***********************************************************************

Reply via email to