in the setAge method, you should pass int as the method parameter as opposed to String.
hope it helps.
 
 
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of kongtao
Sent: Saturday, July 27, 2002 5:00 AM
To: [EMAIL PROTECTED]
Subject: int type property in javaBean

Hello everybody,
I don't sure I can use the integer type property in the javaBeans.
Today ,I completed  a simpe javaBean and give a simple method.
See following:
---------------------------------------------------
    int age;
    public void setAge(String person_age){
       age=Integer.parseInt(person_age);
    }
    public int getAge(){
        return age;
    }
---------------------------------------------------
Unfortunately,following error msg occurs:
<2002/7/27 �U��04��40��09��> <Error> <HTTP> <[WebAppServletContext(6922527,Defau
ltWebApp,/DefaultWebApp)] Servlet failed with Exception
java.lang.NoSuchMethodError: com.sabrina.javabean.PersonInfo.setAge(Ljava/lang/String;)
I was confused by this NoSuchmethodError.
Why?Can't I use the int type property in this javaBean.Pls help me.
Any help would be appreciated.
 

Reply via email to