You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ian Crossfield <ia...@dsl.pipex.com> on 2002/11/04 17:41:52 UTC

Can't find corresponding get method, even though it is there...?

I have an Action form that contains alongside all the other form fields:

    private int targetPage = APPLICATION_PAGE;
    
    public void setTargetPage( int targetPage )
        { this.targetPage = targetPage; }
    public void setTargetPage( String targetPage )
        { this.targetPage = Integer.parseInt( targetPage ); }

    public String getTargetPage()
        { return Integer.toString( this.targetPage ); }

Whenever I uncomment the following line:

  <html:hidden property="targetPage"/>

from my jsp page, within the form I get the error message:
  
  javax.servlet.ServletException: No getter method for property targetPage of 
bean org.apache.struts.taglib.html.BEAN

I have no idea why - this worked perfectly before I switched from Struts 1.0.2 
to Struts 1.1 beta 2, and targetPage is one of many form fields, all of which 
work fine.  Has any idea what could be causing this?

Thanks

Ian



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Can't find corresponding get method, even though it is there...?

Posted by James Mitchell <jm...@telocity.com>.
Remove:

>     public void setTargetPage( int targetPage )
>         { this.targetPage = targetPage; }

...and it will work fine.

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

"Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former."
- Albert Einstein (1879-1955)


> -----Original Message-----
> From: Ian Crossfield [mailto:ian.xfield@dsl.pipex.com]
> Sent: Monday, November 04, 2002 11:42 AM
> To: Struts Users Mailing List
> Subject: Can't find corresponding get method, even though it is
> there...?
>
>
>
> I have an Action form that contains alongside all the other form fields:
>
>     private int targetPage = APPLICATION_PAGE;
>
>     public void setTargetPage( int targetPage )
>         { this.targetPage = targetPage; }
>     public void setTargetPage( String targetPage )
>         { this.targetPage = Integer.parseInt( targetPage ); }
>
>     public String getTargetPage()
>         { return Integer.toString( this.targetPage ); }
>
> Whenever I uncomment the following line:
>
>   <html:hidden property="targetPage"/>
>
> from my jsp page, within the form I get the error message:
>
>   javax.servlet.ServletException: No getter method for property
> targetPage of
> bean org.apache.struts.taglib.html.BEAN
>
> I have no idea why - this worked perfectly before I switched from
> Struts 1.0.2
> to Struts 1.1 beta 2, and targetPage is one of many form fields,
> all of which
> work fine.  Has any idea what could be causing this?
>
> Thanks
>
> Ian
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>