struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgos...@csc.com.au
Subject RE: error- no getter method for property of bean
Date Tue, 03 Feb 2004 22:29:39 GMT
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
________________________________________________________________________



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message