struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank Nguyen" <franktngu...@sbcglobal.net>
Subject RE: error- no getter method for property of bean
Date Wed, 04 Feb 2004 00:53:15 GMT
Thanks to Heya and Wendy. I got it worked! I like both of your suggestion.
For DB, I prefer to label the fields as <tablename>_<fieldname> as much as
possible for many reasons. Torque is pretty good in conforming bean standard
by creating getter/setters as setGroupName()/getGroupName() in the Base
classes and still preserve the database field name (with underscore) as
class' private members. Since I cloned some of the Base code created by
Torque for my form code, I didn't use the bean-conforming method in the JSP
form. I think it's best to get rid of underscore in the JSP forms but
continue to use underscore in DB (thus Torque) as recommended.

-Frank


> -----Original Message-----
> From: hgosper@csc.com.au [mailto:hgosper@csc.com.au]
> Sent: Tuesday, February 03, 2004 2:30 PM
> To: Struts Users Mailing List
> Subject: RE: error- no getter method for property of bean
>
>
> There is a reason why people choose field names like group_name with
> underscore and no "CamelCase": it is to mirror the column names in the
> database. I personally agree with you in general terms but if DBAs insist
> on their "of" notation (the underscore means "of" or something
> syntactically similar, so the field means "name of group") then
> if we want
> to keep our code aligned with the database we will have to use
> underscrores in the field names...
>
> Of course, it is not essential to do this and we could stick to the much
> more bean-standard groupName, getGroupName and setGroupName.
>
> In Frank's case I think the easiest solution would be to change the
> accessors though because there are less changes to make... saves tracking
> down references to this field in the jsp and possibly in validation.xml
> (if using struts validator forms) . The main thing is to understand the
> reason why the method call was not recognized.
>
> Cheers,
> Heya Gosper
> CSC Australia
> 212 Northbourne Ave, Braddon ACT 2612
> Ph: +61 (0) 2 6246 8155  Fax: +61 (0) 2 62468100
> MOB: 0401 611779
> ------------------------------------------------------------------
> ----------------------
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit
> written agreement or government initiative expressly permitting
> the use of
> e-mail for such purpose.
> ------------------------------------------------------------------
> ----------------------
>
>
>
>
>
> Wendy Smoak <Wendy.Smoak@asu.edu>
> 04/02/2004 09:08 AM
> Please respond to "Struts Users Mailing List"
>
>
>         To:     Struts Users Mailing List
> <struts-user@jakarta.apache.org>,
> franktnguyen@sbcglobal.net
>         cc:
>         Subject:        RE: error- no getter method for property of bean
>
>
> > From: Frank Nguyen [mailto:franktnguyen@sbcglobal.net]
> > javax.servlet.ServletException: No getter method for property
> > group_name of bean org.apache.struts.taglib.html.BEAN
>
> I didn't look at anything you attached, but based on this message I'd
> encourage you to stick to property names like 'groupName' and get rid of
> the underscores.  You should then have getGroupName() and setGroupName()
> methods with exactly the same type (and no other similarly named methods
> with different signatures).  For the rest of the rules, read the
> JavaBeans specification.
>
> --
> Wendy Smoak
> Application Systems Analyst, Sr.
> ASU IA Information Resources Management
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ________________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit
> http://www.messagelabs.com
> ________________________________________________________________________
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message