tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John De Lello" <Jo...@DelWare.com>
Subject RE: Logic:Equal Question.
Date Thu, 08 May 2003 17:49:28 GMT
OK, I tried your suggestion and added a method signature of: "public boolean
isHasResults( )" on VWDynaValidatorForm. I get the same results.
javax.servlet.ServletException: Exception accessing property hasResults for
bean paymentReviewForm: java.lang.NoSuchMethodException: Unknown property
'hasResults'

Here is the class definition of my form:

package com.vwks.ing.form;

import org.apache.struts.validator.DynaValidatorForm;

 public class VWDynaValidatorForm extends DynaValidatorForm{
    protected boolean       exceededRowLimit    = false;
    protected boolean       hasResults          = false;

    public boolean isHasResults() {
        return hasResults;
    }

    public boolean getHasResults() {
        return hasResults;
    }


    public void setHasResults(boolean hasResults) {
        this.hasResults = hasResults;
    }
}



Thank you for the responses and sorry about the double-post (not sure how
that happened)
John


-----Original Message-----
From: Jim Kennedy [mailto:jimk@gigaheads.com] 
Sent: Thursday, May 08, 2003 1:35 PM
To: Tag Libraries Users List
Subject: Re: Logic:Equal Question.


Michael, You are correct about the Bean Spec, see below:

JavaBeans Introspection
Sun Microsystems 55 7/24/97
Although use of the standard naming patterns is optional, we strongly
recommend their use as standard naming conventions are an extremely valuable
documentation technique.

8.3 Design Patterns for Properties

8.3.1 Simple properties
By default, we use design patterns to locate properties by looking for
methods of the form: public < PropertyType> get< PropertyName>(); public
void set< PropertyName>(< PropertyType> a); If we discover a matching pair
of "get<PropertyName>" and  "set<PropertyName>" methods that take and return
the same type, then we regard these methods as defining a read-write
property whose name will be "<propertyName>". We will use the
"get<PropertyName>" method to get the property value and the
"set<PropertyName>" method to set the property value. The pair of methods
may be located either in the same class or one may be in a base class and
the other may be in a derived class. If we find only one of these methods,
then we regard it as defining either a read-only or a writeonly property
called "<propertyName>" By default we assume that properties are neither
bound nor constrained (see Section 7). So a simple read-write property "foo"
might be represented by a pair of
methods:
public Wombat getFoo();
public void setFoo(Wombat w);

8.3.2 Boolean properties
In addition, for boolean properties, we allow a getter method to match the
pattern:
public boolean is< PropertyName>();
This "is<PropertyName>" method may be provided instead of a
"get<PropertyName>" method, or it may be provided in addition to a
"get<PropertyName>" method. In either case, if the "is<PropertyName>" method
is present for a boolean property then we will use the "is<PropertyName>"
method to read the property value. An example boolean property might be:
public boolean isMarsupial(); public void setMarsupial(boolean m);

8.3.3 Indexed properties
If we find a property whose type is an array "<PropertyElement>[]", then we
also look for methods of the form: public < PropertyElement> get<
PropertyName>(int a); public void set< PropertyName>(int a, <
PropertyElement> b); If we find either kind of pattern then we assume that
"<propertyName>" is an indexed property and that these methods can be used
to read and/or write an indexed value. Thus an indexed property "foo" might
be represented by four accessor
methods:

Jim Kennedy
IT Consultant
Mobile Phone: 813-503-1484
-----------------------------------------------------




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





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


Mime
View raw message