struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: Use of Iterator tag
Date Wed, 14 Aug 2002 19:28:16 GMT


On Wed, 14 Aug 2002, nathan phillips wrote:

> Date: Wed, 14 Aug 2002 19:16:46 +0000
> From: nathan phillips <nathanpp@hotmail.com>
> Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: RE: Use of Iterator tag
>
> You may disagree, but I feel that it would be bad design to have both.  I
> guess my thinking is that by providing both you start making your API
> confusing and polluted.  Some people will use iterator some will use
> getIterator and someone will have to check the Javadoc to see what the
> difference is only to discover that there is none.
>
> Another reasoning point is that you don't see "getIterator" in
> java.util.Collection.  "iterator" just seems cleaner.

Philosophically, you can easily contend that an iterator is not a
property, because it has very restricted lifetime and state.

>  I don't want to have
> to bend my software to fit a framework.  A framework should bend to fit
> mine.  But that's just my feeling about the matter:)  No big deal.
>

The framework doesn't have to bend ... JavaBeans already provides you a
way to accomplish what you want, and it's up to *you* to make your classes
obey the rules (see my previous post about making your own BeanInfo class
to tell Java that you have an "iterator" property).

> Thanks for everyone's input.


Craig

>
>
> From: Troy Hart <thart@part.net>
> Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> To: dmarine@athensgroup.com
> CC: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
> Subject: RE: Use of Iterator tag
> Date: 14 Aug 2002 13:01:55 -0600
> MIME-Version: 1.0
> Received: from [192.18.49.131] by hotmail.com (3.2) with ESMTP id
> MHotMailBF23F4F8001F4004324AC0123183F5E00; Wed, 14 Aug 2002 12:05:28 -0700
> Received: (qmail 25432 invoked by uid 97); 14 Aug 2002 19:05:29 -0000
> Received: (qmail 25380 invoked by uid 98); 14 Aug 2002 19:05:28 -0000
> >From struts-user-return-43251-nathanpp Wed, 14 Aug 2002 12:06:15 -0700
> Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm
> Precedence: bulk
> List-Unsubscribe: <mailto:struts-user-unsubscribe@jakarta.apache.org>
> List-Subscribe: <mailto:struts-user-subscribe@jakarta.apache.org>
> List-Help: <mailto:struts-user-help@jakarta.apache.org>
> List-Post: <mailto:struts-user@jakarta.apache.org>
> List-Id: "Struts Users Mailing List" <struts-user.jakarta.apache.org>
> Delivered-To: mailing list struts-user@jakarta.apache.org
> X-Antivirus: nagoya (v4198 created Apr 24 2002)
> In-Reply-To: <006201c243b7$80d4efb0$4b01a8c0@FCRIL>
> References: <006201c243b7$80d4efb0$4b01a8c0@FCRIL>
> X-Mailer: Ximian Evolution 1.0.3 (1.0.3-4)
> Message-Id: <1029351746.8954.92.camel@mercury.part.net>
> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>
> Why not have both?
>
> public Iterator getIterator() {
>    return this.iterator();
> }
>
> Troy
>
> On Wed, 2002-08-14 at 11:24, David Marine wrote:
>  > The convention of naming the method to access a collection's iterator
>  > "iterator" instead of the Bean compliant "getIterator" is one set by Sun
>  > itself. It is unfortunate, however, while renaming your method makes it
>  > inconsistent with the method naming used in the Java collections, it
>  > will make the method comply with Java Bean naming conventions... And
>  > work with STRUTS!
>  >
>  >
>  > -----Original Message-----
>  > From: Kamholz, Keith (corp-staff) USX [mailto:kkamholz@moog.com]
>  > Sent: Wednesday, August 14, 2002 12:15 PM
>  > To: 'Struts Users Mailing List'
>  > Subject: RE: Use of Iterator tag
>  >
>  >
>  > You're trying to bypass the internal workings of struts.  That's just
>  > the way struts works, if you want to pull the iterator out of the bean,
>  > you need the get method.  If you want to keep the iterator method only
>  > because it's used else where and you don't want to change it in those
>  > places, I suppose you could have both.  It results in slightly longer
>  > code, but you could have both if you wanted to.
>  >
>  > ~ Keith
>  > http://www.buffalo.edu/~kkamholz
>  >
>  >
>  > -----Original Message-----
>  > From: nathan phillips [mailto:nathanpp@hotmail.com]
>  > Sent: Wednesday, August 14, 2002 1:12 PM
>  > To: struts-user@jakarta.apache.org
>  > Subject: RE: Use of Iterator tag
>  >
>  >
>  > I simply have a method named "iterator" in my bean that I'd like to use.
>  > If
>  >
>  > I rename it to "getIterator" then it works fine.  However, I don't want
>  > to
>  > rename my method to "getIterator."  Any ideas?
>  >
>  >
>  > From: "Kamholz, Keith   (corp-staff) USX" <kkamholz@moog.com>
>  > Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>  > To: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
>  > Subject: RE: Use of Iterator tag
>  > Date: Wed, 14 Aug 2002 13:00:31 -0400
>  > MIME-Version: 1.0
>  > Received: from nagoya.betaversion.org ([192.18.49.131]) by
>  > mc2-f26.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.4905); Wed, 14
>  > Aug
>  >
>  > 2002 10:02:55 -0700
>  > Received: (qmail 18489 invoked by uid 97); 14 Aug 2002 17:02:12 -0000
>  > Received: (qmail 18438 invoked by uid 98); 14 Aug 2002 17:02:12 -0000
>  > Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm
>  > Precedence: bulk
>  > List-Unsubscribe: <mailto:struts-user-unsubscribe@jakarta.apache.org>
>  > List-Subscribe: <mailto:struts-user-subscribe@jakarta.apache.org>
>  > List-Help: <mailto:struts-user-help@jakarta.apache.org>
>  > List-Post: <mailto:struts-user@jakarta.apache.org>
>  > List-Id: "Struts Users Mailing List" <struts-user.jakarta.apache.org>
>  > Delivered-To: mailing list struts-user@jakarta.apache.org
>  > X-Antivirus: nagoya (v4198 created Apr 24 2002)
>  > Message-ID: <A39EEA2C33B08346A5D92E8DC6BD6B5404135034@m20nbn11.moog.com>
>  > X-Mailer: Internet Mail Service (5.5.2653.19)
>  > X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>  > Return-Path:
>  > struts-user-return-43235-nathanpp=hotmail.com@jakarta.apache.org
>  > X-OriginalArrivalTime: 14 Aug 2002 17:02:56.0924 (UTC)
>  > FILETIME=[6FD59DC0:01C243B4]
>  >
>  > Oh, you're trying to do this without a get method?  Why don't you want
>  > to use the get method?  How else would you like to retrieve the iterator
>  > from your bean?
>  >
>  > ~ Keith
>  > http://www.buffalo.edu/~kkamholz
>  >
>  >
>  >
>  > -----Original Message-----
>  > From: nathan phillips [mailto:nathanpp@hotmail.com]
>  > Sent: Wednesday, August 14, 2002 12:53 PM
>  > To: struts-user@jakarta.apache.org
>  > Subject: RE: Use of Iterator tag
>  >
>  >
>  > Hi Keith,
>  >
>  > Thanks for the fast response.  I've since added the type per your
>  > suggestion.  However, it still complains that the method "iterator" has
>  > no getter.  When I add "getIterator" to my class it works fine.  There
>  > must be a way to get this to work without having to use a getter method.
>  >
>  >
>  > From: "Kamholz, Keith   (corp-staff) USX" <kkamholz@moog.com>
>  > Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>  > To: 'Struts Users Mailing List' <struts-user@jakarta.apache.org>
>  > Subject: RE: Use of Iterator tag
>  > Date: Wed, 14 Aug 2002 12:41:49 -0400
>  > MIME-Version: 1.0
>  > Received: from [192.18.49.131] by hotmail.com (3.2) with ESMTP id
>  > MHotMailBF23D3A3008840043194C0123183CA0B0; Wed, 14 Aug 2002 09:43:15
>  > -0700
>  > Received: (qmail 26214 invoked by uid 97); 14 Aug 2002 16:43:28 -0000
>  > Received: (qmail 26202 invoked by uid 98); 14 Aug 2002 16:43:27 -0000
>  > From struts-user-return-43223-nathanpp Wed, 14 Aug 2002 09:44:18 -0700
>  > Mailing-List: contact struts-user-help@jakarta.apache.org; run by ezmlm
>  > Precedence: bulk
>  > List-Unsubscribe: <mailto:struts-user-unsubscribe@jakarta.apache.org>
>  > List-Subscribe: <mailto:struts-user-subscribe@jakarta.apache.org>
>  > List-Help: <mailto:struts-user-help@jakarta.apache.org>
>  > List-Post: <mailto:struts-user@jakarta.apache.org>
>  > List-Id: "Struts Users Mailing List" <struts-user.jakarta.apache.org>
>  > Delivered-To: mailing list struts-user@jakarta.apache.org
>  > X-Antivirus: nagoya (v4198 created Apr 24 2002)
>  > Message-ID: <A39EEA2C33B08346A5D92E8DC6BD6B5404135033@m20nbn11.moog.com>
>  > X-Mailer: Internet Mail Service (5.5.2653.19)
>  > X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>  >
>  > Hey,
>  >
>  > For your first question, I think you should specify the 'type' attribute
>  > of the iterate tag.  This indicates the type of variable that the
>  > collection contains, and is pretty important (i think).
>  >
>  > For the radio button, use a little scriptlet to set the value.  In your
>  > case it would be: <html:radio property="myId" value="<%= test.getId()
>  > %>" />
>  >
>  > I think you should get the iterate tag working before you try to make
>  > the radio button work though, cuz the radio button problems could be
>  > tied to your iteration issues. Does this help you at all?
>  >
>  > ~ Keith
>  > http://www.buffalo.edu/~kkamholz
>  >
>  >
>  >
>  > -----Original Message-----
>  > From: nathan phillips [mailto:nathanpp@hotmail.com]
>  > Sent: Wednesday, August 14, 2002 12:33 PM
>  > To: struts-user@jakarta.apache.org
>  > Subject: Use of Iterator tag
>  >
>  >
>  >
>  > Hello all,
>  >
>  > I'm new to Struts and attempting to make use of the iterator tag.  I
>  > have a couple questions that I'm hoping some kind individual can help me
>  > answer in regards to the iterator tag.  I have a bean with a method
>  > named "iterator" that returns an iterator.
>  >
>  > If I do this it tells me I have no getter for my method iterator, which
>  > of course is true. <logic:iterate name="testbean" property="iterator"
>  > id="test">
>  >
>  > So how do I make it work.  I see that there is a collection attribute
>  > that might work but I'm unsure of how exactly to make use of it.  I was
>  > thinking something along the lines of: <logic:iterate name="testbean"
>  > collection=<%=testbean.iterator()%>
>  > id="test">
>  >
>  > Of course that doesn't work though.
>  >
>  > My second question is how would do I write out a property for the radio
>  > tag within a iterator tag.  I'm attempting the following with no
>  > success.  It tells me "test" is out of scope however the same bean:write
>  > works fine outside of the radio tag.
>  >
>  > <logic:iterate name="testbean" property="iterator" id="test">
>  >     <html:radio property="myId" value="<bean:write name="test"
>  > property="id"/>" </logic:iterate>
>  >
>  > Any help in solving these mysteries for me would be greatly appreciated.
>  > Thanks.
>  >
>  >
>  >
>  >
>  > _________________________________________________________________
>  > MSN Photos is the easiest way to share and print your photos:
>  > http://photos.msn.com/support/worldwide.aspx
>  >
>  >
>  > --
>  > 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>
>  >
>  >
>  >
>  >
>  >
>  > _________________________________________________________________
>  > Join the world's largest e-mail service with MSN Hotmail.
>  > http://www.hotmail.com
>  >
>  >
>  > --
>  > 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>
>  >
>  >
>  >
>  >
>  > _________________________________________________________________
>  > Join the world's largest e-mail service with MSN Hotmail.
>  > http://www.hotmail.com
>  >
>  >
>  > --
>  > 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>
>  >
>  >
>  > --
>  > 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>
>
>
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> 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