struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jitendra Singh" <jits_1...@hotmail.com>
Subject Re: no getter method for property phoneList
Date Mon, 23 Dec 2002 14:57:51 GMT
got it ..
thanks

Jitendra
----- Original Message -----
From: "Siggelkow, Bill" <bill.siggelkow@mirant.com>
To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
Sent: Monday, December 23, 2002 8:14 PM
Subject: RE: no getter method for property phoneList


> Try using --
> <html:text property="adminRight[2]"/>
>
> -----Original Message-----
> From: Jitendra Singh [mailto:jits_1998@hotmail.com]
> Sent: Monday, December 23, 2002 9:32 AM
> To: Struts Users Mailing List
> Subject: Re: no getter method for property phoneList
>
>
> I am trying as given on the apache server ... but getting this
error..Please
> tell me if i am missing something.
>
> com.ibm.servlet.engine.webapp.WebAppErrorReport: No getter method for
> property adminRight(2) of bean org.apache.struts.taglib.html.BEAN
>
> my jsp says :
> <html:text property="adminRight(2)"/>
>
> my form class is :
>
> public class MRSecurityForm extends ActionForm {
>
> private ArrayList novelLogins;
>
>
>
> private ArrayList adminRights;
>
> public Object getNovelLogin(int index) {
>
> return novelLogins.get(index);
>
> }
>
>
> public void setNovelLogin(int index, Object lNovelLogin) {
>
> novelLogins.set(index, lNovelLogin);
>
> }
>
>
> public Object getAdminRight(int index) {
>
> return adminRights.get(index);
>
> }
>
>
> public void setAdminRight(int index, Object lAdminRights) {
>
> adminRights.set(index, lAdminRights);
>
> }
>
> }
>
>
>
> ----- Original Message -----
> From: "Richard Yee" <ryee86@yahoo.com>
> To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> Sent: Saturday, December 21, 2002 3:24 AM
> Subject: RE: no getter method for property phoneList
>
>
> > Take a look at this page:
> >
>
http://jakarta.apache.org/struts/userGuide/building_controller.html#map_acti
> on_form_classes
> >
> >
> > The problem is that you don't have methods to get the
> > individual items from your lists. You need methods
> > such as
> >
> > public String getPhoneItem(int index) {
> >   return phoneList_.get(index)
> > }
> >
> > public void setPhoneItem(int index, Object obj)
> > {
> >  phoneList_.set(index,obj);
> > }
> >
> > The actual names of the methods don't really matter.
> >
> > You will have to add code to the getter method so that
> > you won't get an ArrayIndexOutOfBounds exception when
> > the getter is called and the list is empty. This topic
> > has been discussed on the list a few times over the
> > last week or two.
> >
> > Regards,
> >
> > Richard
> >
> > --- Raffy_Lata@ffic.com wrote:
> > >
> > > I tried almost every combination. Reversing the
> > > order, doing just the
> > > addressList then the just the phoneList. Whatever
> > > combination I use, the
> > > addressList is always introspected ok while the
> > > phoneList isn't. I even
> > > tried renaming the getPhoneList() to
> > > getTelephoneList() and then tried to
> > > invoke that method with the same problem. I even
> > > tried copying
> > > getAddressList() and renamed to getPhoneList() and
> > > that didn't work either.
> > > I also tried deleting the pre-compiled jsps to make
> > > sure I get fresh ones
> > > when I bring up the jsp.
> > >
> > > The problem, as I observed it, is when
> > > PropertyUtils.copyProperty (this is
> > > RequestUtils.lookup) is invoked to retrieve the
> > > bean's method and it
> > > couldn't find it. I traced all variables and objects
> > > being passed to it and
> > > I didn't see anything peculiar. I don't have the
> > > source code for the
> > > beanutils package so I can't trace it any farther
> > > than the copyProperty
> > > method.
> > >
> > > It may also be how I defined my bean, but I checked
> > > it inside/out and
> > > compare it with my other classes with similar
> > > structure.
> > >
> > > What I ended up doing, which is not scientific, is
> > > to recreate my Party
> > > class one attribute/one method at a time. After,
> > > say, creating addressList
> > > and it's accessors, I tested it to make sure the
> > > iterate tag works. Then I
> > > added phoneList and to my surprise, it worked. Then
> > > I proceeded to add all
> > > my other attributes/mtehods/etc. It wasted a day or
> > > work and I still wasn't
> > > able to figure out why it happened in the first
> > > place.
> > >
> > > Thanks for the responses and if anybody encounters
> > > the same problem, which
> > > is really sooo weird, I'd like to find out if he/she
> > > ever solved it without
> > > doing what I did.
> > >
> > > Thanks again.
> > >
> > >
> > >
> > >
> > >
> > > <Greg.Reddin@alltel.com> on 12/20/2002 10:44:44 AM
> > >
> > > Please respond to "Struts Users Mailing List"
> > >       <struts-user@jakarta.apache.org>
> > >
> > > To:   <struts-user@jakarta.apache.org>
> > > cc:
> > > Subject:  RE: no getter method for property
> > > phoneList
> > >
> > >
> > > Here's some questions:
> > >
> > > 1) If you reverse the order of the iterate tags,
> > > iterating over phoneList
> > > first and addressList second, do you get the same
> > > results?
> > >
> > > 2) Does the address information render correctly if
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> > http://mailplus.yahoo.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>


Mime
View raw message