You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Wax, Michael" <mw...@vantra.com> on 2001/03/08 18:36:02 UTC

Problem with multiple submit image buttons

I need to determine which of several html:image buttons in a form has been
clicked.  I have tried the following:

public class MyForm extends ActionForm {
...
private MyFormBean bean1 = new MyFormBean();
private MyFormBean bean2 = new MyFormBean();
...
public MyFormBean getBean1 () {return bean1;}
public void setBean1 (MyFormBean bean1) {this.bean1=bean1;}
...
}

The MyFormBean class has accessors for x and y.

Unfortunately, although the request contains bean.x and bean.y values
whenever the button with the property "bean1" has been clicked, getBean1()
returns null.

Am I doing something wrong?  Is there an alternative method of
distinguishing between html:image buttons?

Re: Question about PropUtils.copyProperties()

Posted by Maya Muchnik <mm...@pumatech.com>.
All getters and setters have to follow a JavaBean convention. This means
you can have getCc_number(), not getcc_number(). The second thing the
properties names have to match (case sensitive) in a source and destination
beans.

Bryan Field-Elliot wrote:

> Question -- in evaluating names of properties (get/setter methods), does
> it do a case-INsensitive match, or case-sensitive?
>
> Due to the tool I'm using, some classes have method names like:
>
> getcc_number()
> putcc_number()
>
> while others will have it as:
>
> getCc_number()
> putCc_number()
>
> Will these be considered a "match" by the copyProperties() function?
>
> Thanks,
> Bryan


Question about PropUtils.copyProperties()

Posted by Bryan Field-Elliot <br...@netmeme.org>.
Question -- in evaluating names of properties (get/setter methods), does 
it do a case-INsensitive match, or case-sensitive?

Due to the tool I'm using, some classes have method names like:

getcc_number()
putcc_number()

while others will have it as:

getCc_number()
putCc_number()

Will these be considered a "match" by the copyProperties() function?

Thanks,
Bryan