I have a standard java bean.  The different thing about it is that I
usually have two overloaded set methods per attribute.  For example,

public class MyBean {
    private int a;

    public setA (int a) throws Exception {
        if (a > 100) throw new Exception ("Must be less than 100");
    }

    public setA (String a) throws Exception {
        try {
            setA(Integer.parseInt(a));
        } catch (NumberFormat Exception exception) {
            throw new Exception ("Format incorrect.");
        }
    }

    //I usually have one getA
    public int getA() {
        return a;
    }
}


Now when I use this bean in a JSP that is stored in the request scope,
at times the compiler will complain that it cannot find a get method for
"A".  Even though one get method for that particular attribute is
clearly there.

Some added information, I use Forte Community Edition 2, and Tomcat.
Forte's compiler complains about one attribute while Tomcat complains
about another completely different attribute it cannot find the get
method for.  Which makes me itch with anger.  The note is my example
above is very simple. I used it just to explain my problem.  My actual
bean has about 17 attributes all with 2 setter methods each and 1 get
method each.

Does anyone know how to resolve this issue?

Thanks for your help.
Dan Hinojosa



Reply via email to