Re: ??? property naming convention problem

2004-12-14 Thread Kris Schneider
Jim, you're kidding, right? The original post had nothing to do with 
variable names and specifically related to bean property names. The key 
question from the original post is:

Is there a property naming convention to be followed in STRUTS
The answer is, yes. In general, property names follow the JavaBeans 
Spec. However, by leveraging Commons BeanUtils:

http://jakarta.apache.org/commons/beanutils/commons-beanutils-1.6.1/docs/api/org/apache/commons/beanutils/package-summary.html
Struts is able to provide some additional functionality, like mapped 
properties.

Jim Barrows wrote:

-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 14, 2004 12:51 PM
To: Struts Users Mailing List
Subject: RE: ??? property naming convention problem
Is that supposed to be some sort of bluff? What do variable 
names have to do
with bean properties? By default, property names are derived 
from *method*
names. For example, the property exposed by TimeZone.getID() 
is "ID", but the
property exposed by SSLSession.getId() is "id".

No.  The original question dealt with variable names, which is what I was 
responding to, not a general discussion of Beans that this thread has turned 
into.


Quoting Jim Barrows <[EMAIL PROTECTED]>:

-Original Message-
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 14, 2004 10:45 AM
To: Struts Users Mailing List
Subject: RE: ??? property naming convention problem
Quoting Jim Barrows <[EMAIL PROTECTED]>:

-Original Message-
From: Daniel Perry [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 14, 2004 7:52 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: ??? property naming convention problem
This is confusing.  The bean spec / article is talking about 
going from a
method name into a property name.  The problem here is the 
other way round.
WHat's confusing?  Bean property names must begin with 
lowercase first
letter.  Getters and Setters capitalize this.
I've never had this issue.  properties are always eCoupon 
and setECoupon and
getEcoupon.
Actually, no. It's perfectly legal for a property name to 
begin with an upper
case letter. Again, see:

http://wiki.apache.org/struts/JavaBeans
I see your specification and raise you the coding style: 
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367

Variables

Except for variables, all instance, class, and class 
constants are in mixed
case with a lowercase first letter. Internal words start 
with capital
letters. Variable names should not start with underscore _ 
or dollar sign $
characters, even though both are allowed.
Variable names should be short yet meaningful. The choice 
of a variable name
should be mnemonic- that is, designed to indicate to the 
casual observer the
intent of its use. One-character variable names should be 
avoided except for
temporary "throwaway" variables. Common names for temporary 
variables are i,
j, k, m, and n for integers; c, d, and e for characters.

int i;
charc;
float   myWidth;

Eg, decapitalise method->property will convert: 
getECoupon -> ECoupon
But it doesnt mention property->method capitalise: eCoupon -> 
getECoupon /
geteCoupon

I think the assumption has been made that if youre going 
to go from
getECoupon ->ECoupon that you must go from 
ECoupon->getECoupon and therefore
eCoupon->geteCoupon

However the spec doesnt say that this should be a reversible 
process, so why
not eCoupon->getECoupon

Daniel.

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: 14 December 2004 14:01
To: Struts Users Mailing List
Subject: Re: ??? property naming convention problem
Sure is mate!. Its all in the javabean specs
This post should enlighten you further:

http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
And for another getter/setter 'gotcha' you can read this 
thread through

http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
hth
Andrew
Vinod Easaw Varghese wrote:
Hi,
   I have a textbox in a JSP whose property has been 
named as eCoupon.
I have created the necessary ActionForm with the 
necessary setter and
getter methods such as setECoupon and getECoupon.
   When I run submit the form within the corresponding 
JSP I get the
error message not able to find the corresponding getter method for
property eCoupon
   The moment I changed the property name to ecoupon and made the
necessary adjustments within the ActionForm all began to 
work well.
Is there a property naming convention to be followed in STRUTS
With thanks and Regards
Vinod Easaw Varghese
--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ??? property naming convention problem

2004-12-14 Thread Andrew Hill
Sure is mate!. Its all in the javabean specs
This post should enlighten you further:
http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
And for another getter/setter 'gotcha' you can read this thread through
http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
hth
Andrew
Vinod Easaw Varghese wrote:
Hi,
 
I have a textbox in a JSP whose property has been named as eCoupon.
I have created the necessary ActionForm with the necessary setter and
getter methods such as setECoupon and getECoupon. 
When I run submit the form within the corresponding JSP I get the
error message not able to find the corresponding getter method for
property eCoupon
The moment I changed the property name to ecoupon and made the
necessary adjustments within the ActionForm all began to work well.

Is there a property naming convention to be followed in STRUTS
 

With thanks and Regards
Vinod Easaw Varghese
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: ??? property naming convention problem

2004-12-14 Thread Jim Barrows


> -Original Message-
> From: Kris Schneider [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 12:51 PM
> To: Struts Users Mailing List
> Subject: RE: ??? property naming convention problem
> 
> 
> Is that supposed to be some sort of bluff? What do variable 
> names have to do
> with bean properties? By default, property names are derived 
> from *method*
> names. For example, the property exposed by TimeZone.getID() 
> is "ID", but the
> property exposed by SSLSession.getId() is "id".


No.  The original question dealt with variable names, which is what I was 
responding to, not a general discussion of Beans that this thread has turned 
into.



> 
> Quoting Jim Barrows <[EMAIL PROTECTED]>:
> 
> > 
> > > -Original Message-
> > > From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, December 14, 2004 10:45 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: ??? property naming convention problem
> > > 
> > > 
> > > Quoting Jim Barrows <[EMAIL PROTECTED]>:
> > > 
> > > > > -Original Message-
> > > > > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > > > > Sent: Tuesday, December 14, 2004 7:52 AM
> > > > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > > > Subject: RE: ??? property naming convention problem
> > > > > 
> > > > > 
> > > > > This is confusing.  The bean spec / article is talking about 
> > > > > going from a
> > > > > method name into a property name.  The problem here is the 
> > > > > other way round.
> > > > 
> > > > WHat's confusing?  Bean property names must begin with 
> > > lowercase first
> > > > letter.  Getters and Setters capitalize this.
> > > > I've never had this issue.  properties are always eCoupon 
> > > and setECoupon and
> > > > getEcoupon.
> > > 
> > > Actually, no. It's perfectly legal for a property name to 
> > > begin with an upper
> > > case letter. Again, see:
> > > 
> > > http://wiki.apache.org/struts/JavaBeans
> > 
> > I see your specification and raise you the coding style: 
> > http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367
> > 
> > Variables
> > 
> > 
> > Except for variables, all instance, class, and class 
> constants are in mixed
> > case with a lowercase first letter. Internal words start 
> with capital
> > letters. Variable names should not start with underscore _ 
> or dollar sign $
> > characters, even though both are allowed.
> > 
> > Variable names should be short yet meaningful. The choice 
> of a variable name
> > should be mnemonic- that is, designed to indicate to the 
> casual observer the
> > intent of its use. One-character variable names should be 
> avoided except for
> > temporary "throwaway" variables. Common names for temporary 
> variables are i,
> > j, k, m, and n for integers; c, d, and e for characters.
> > 
> > 
> > int i;
> > charc;
> > float   myWidth;
> > 
> > > 
> > > > > Eg, decapitalise method->property will convert: 
> > > getECoupon -> ECoupon
> > > > > But it doesnt mention property->method capitalise: eCoupon -> 
> > > > > getECoupon /
> > > > > geteCoupon
> > > > > 
> > > > > I think the assumption has been made that if youre going 
> > > to go from
> > > > > getECoupon ->ECoupon that you must go from 
> > > > > ECoupon->getECoupon and therefore
> > > > > eCoupon->geteCoupon
> > > > > 
> > > > > However the spec doesnt say that this should be a reversible 
> > > > > process, so why
> > > > > not eCoupon->getECoupon
> > > > > 
> > > > > Daniel.
> > > > > 
> > > > > > -Original Message-
> > > > > > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > > > > > Sent: 14 December 2004 14:01
> > > > > > To: Struts Users Mailing List
> > > > > > Subject: Re: ??? property naming convention problem
> > > > > >
> > > > > >
> > > > > > Sure is mate!. Its all in the javabean specs
> > > > > >
> > &g

RE: ??? property naming convention problem

2004-12-14 Thread Kris Schneider
Is that supposed to be some sort of bluff? What do variable names have to do
with bean properties? By default, property names are derived from *method*
names. For example, the property exposed by TimeZone.getID() is "ID", but the
property exposed by SSLSession.getId() is "id".

Quoting Jim Barrows <[EMAIL PROTECTED]>:

> 
> > -Original Message-
> > From: Kris Schneider [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 14, 2004 10:45 AM
> > To: Struts Users Mailing List
> > Subject: RE: ??? property naming convention problem
> > 
> > 
> > Quoting Jim Barrows <[EMAIL PROTECTED]>:
> > 
> > > > -Original Message-
> > > > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, December 14, 2004 7:52 AM
> > > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > > Subject: RE: ??? property naming convention problem
> > > > 
> > > > 
> > > > This is confusing.  The bean spec / article is talking about 
> > > > going from a
> > > > method name into a property name.  The problem here is the 
> > > > other way round.
> > > 
> > > WHat's confusing?  Bean property names must begin with 
> > lowercase first
> > > letter.  Getters and Setters capitalize this.
> > > I've never had this issue.  properties are always eCoupon 
> > and setECoupon and
> > > getEcoupon.
> > 
> > Actually, no. It's perfectly legal for a property name to 
> > begin with an upper
> > case letter. Again, see:
> > 
> > http://wiki.apache.org/struts/JavaBeans
> 
> I see your specification and raise you the coding style: 
> http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367
> 
> Variables
>   
> 
> Except for variables, all instance, class, and class constants are in mixed
> case with a lowercase first letter. Internal words start with capital
> letters. Variable names should not start with underscore _ or dollar sign $
> characters, even though both are allowed.
> 
> Variable names should be short yet meaningful. The choice of a variable name
> should be mnemonic- that is, designed to indicate to the casual observer the
> intent of its use. One-character variable names should be avoided except for
> temporary "throwaway" variables. Common names for temporary variables are i,
> j, k, m, and n for integers; c, d, and e for characters.
>   
> 
> int i;
> charc;
> float   myWidth;
> 
> > 
> > > > Eg, decapitalise method->property will convert: 
> > getECoupon -> ECoupon
> > > > But it doesnt mention property->method capitalise: eCoupon -> 
> > > > getECoupon /
> > > > geteCoupon
> > > > 
> > > > I think the assumption has been made that if youre going 
> > to go from
> > > > getECoupon ->ECoupon that you must go from 
> > > > ECoupon->getECoupon and therefore
> > > > eCoupon->geteCoupon
> > > > 
> > > > However the spec doesnt say that this should be a reversible 
> > > > process, so why
> > > > not eCoupon->getECoupon
> > > > 
> > > > Daniel.
> > > > 
> > > > > -Original Message-
> > > > > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > > > > Sent: 14 December 2004 14:01
> > > > > To: Struts Users Mailing List
> > > > > Subject: Re: ??? property naming convention problem
> > > > >
> > > > >
> > > > > Sure is mate!. Its all in the javabean specs
> > > > >
> > > > > This post should enlighten you further:
> > > > >
> > > > > http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> > > > >
> > > > >
> > > > > And for another getter/setter 'gotcha' you can read this 
> > > > thread through
> > > > >
> > > > > 
> http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> > > >
> > > > hth
> > > > Andrew
> > > >
> > > > Vinod Easaw Varghese wrote:
> > > > > Hi,
> > > > >
> > > > > I have a textbox in a JSP whose property has been 
> > > named as eCoupon.
> > > > > I have created the necessary ActionForm with the 
> > > necessary setter and
> > > > > getter methods such as setECoupon and getECoupon.
> > > > > When I run submit the form within the corresponding 
> > > JSP I get the
> > > > > error message not able to find the corresponding getter method for
> > > > > property eCoupon
> > > > > The moment I changed the property name to ecoupon and made the
> > > > > necessary adjustments within the ActionForm all began to 
> > > work well.
> > > > >
> > > > > Is there a property naming convention to be followed in STRUTS
> > > > >
> > > > >
> > > > > With thanks and Regards
> > > > >
> > > > > Vinod Easaw Varghese
> 
> -- 
> Kris Schneider <mailto:[EMAIL PROTECTED]>
> D.O.Tech   <http://www.dotech.com/>

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ??? property naming convention problem

2004-12-14 Thread Kandula, Sunita
A property need not always imply a private member variable in a bean.

for example: MyBean.java
private map values = new HashMap();

public String getFirstName() {
return (String)values.get("firstname");
}

public void setFirstName(String firstNameIn) {
  values.put("firstName",firstNameIn);
}

Here firstName is a property of MyBean that can be used in a jsp :




-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 14, 2004 1:28 PM
To: Struts Users Mailing List
Subject: RE: ??? property naming convention problem




> -Original Message-
> From: Kris Schneider [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 10:45 AM
> To: Struts Users Mailing List
> Subject: RE: ??? property naming convention problem
> 
> 
> Quoting Jim Barrows <[EMAIL PROTECTED]>:
> 
> > > -Original Message-
> > > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, December 14, 2004 7:52 AM
> > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > Subject: RE: ??? property naming convention problem
> > > 
> > > 
> > > This is confusing.  The bean spec / article is talking about 
> > > going from a
> > > method name into a property name.  The problem here is the 
> > > other way round.
> > 
> > WHat's confusing?  Bean property names must begin with 
> lowercase first
> > letter.  Getters and Setters capitalize this.
> > I've never had this issue.  properties are always eCoupon 
> and setECoupon and
> > getEcoupon.
> 
> Actually, no. It's perfectly legal for a property name to 
> begin with an upper
> case letter. Again, see:
> 
> http://wiki.apache.org/struts/JavaBeans

I see your specification and raise you the coding style: 
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367

Variables


Except for variables, all instance, class, and class constants are in mixed
case with a lowercase first letter. Internal words start with capital
letters. Variable names should not start with underscore _ or dollar sign $
characters, even though both are allowed.

Variable names should be short yet meaningful. The choice of a variable name
should be mnemonic- that is, designed to indicate to the casual observer the
intent of its use. One-character variable names should be avoided except for
temporary "throwaway" variables. Common names for temporary variables are i,
j, k, m, and n for integers; c, d, and e for characters.


int i;
charc;
float   myWidth;

> 
> > > Eg, decapitalise method->property will convert: 
> getECoupon -> ECoupon
> > > But it doesnt mention property->method capitalise: eCoupon -> 
> > > getECoupon /
> > > geteCoupon
> > > 
> > > I think the assumption has been made that if youre going 
> to go from
> > > getECoupon ->ECoupon that you must go from 
> > > ECoupon->getECoupon and therefore
> > > eCoupon->geteCoupon
> > > 
> > > However the spec doesnt say that this should be a reversible 
> > > process, so why
> > > not eCoupon->getECoupon
> > > 
> > > Daniel.
> > > 
> > > > -Original Message-
> > > > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > > > Sent: 14 December 2004 14:01
> > > > To: Struts Users Mailing List
> > > > Subject: Re: ??? property naming convention problem
> > > >
> > > >
> > > > Sure is mate!. Its all in the javabean specs
> > > >
> > > > This post should enlighten you further:
> > > >
> > > > http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> > > >
> > > >
> > > > And for another getter/setter 'gotcha' you can read this 
> > > thread through
> > > >
> > > > 
http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> > >
> > > hth
> > > Andrew
> > >
> > > Vinod Easaw Varghese wrote:
> > > > Hi,
> > > >
> > > > I have a textbox in a JSP whose property has been 
> > named as eCoupon.
> > > > I have created the necessary ActionForm with the 
> > necessary setter and
> > > > getter methods such as setECoupon and getECoupon.
> > > > When I run submit the form within the corresponding 
> > JSP I get the
> > > > error message not able to find the corresponding getter method for
> > > > property eCoupon
> > > > 

RE: ??? property naming convention problem

2004-12-14 Thread Kris Schneider
Quoting Jim Barrows <[EMAIL PROTECTED]>:

> > -Original Message-
> > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, December 14, 2004 7:52 AM
> > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > Subject: RE: ??? property naming convention problem
> > 
> > 
> > This is confusing.  The bean spec / article is talking about 
> > going from a
> > method name into a property name.  The problem here is the 
> > other way round.
> 
> WHat's confusing?  Bean property names must begin with lowercase first
> letter.  Getters and Setters capitalize this.
> I've never had this issue.  properties are always eCoupon and setECoupon and
> getEcoupon.

Actually, no. It's perfectly legal for a property name to begin with an upper
case letter. Again, see:

http://wiki.apache.org/struts/JavaBeans

> > Eg, decapitalise method->property will convert: getECoupon -> ECoupon
> > But it doesnt mention property->method capitalise: eCoupon -> 
> > getECoupon /
> > geteCoupon
> > 
> > I think the assumption has been made that if youre going to go from
> > getECoupon ->ECoupon that you must go from 
> > ECoupon->getECoupon and therefore
> > eCoupon->geteCoupon
> > 
> > However the spec doesnt say that this should be a reversible 
> > process, so why
> > not eCoupon->getECoupon
> > 
> > Daniel.
> > 
> > > -Original Message-
> > > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > > Sent: 14 December 2004 14:01
> > > To: Struts Users Mailing List
> > > Subject: Re: ??? property naming convention problem
> > >
> > >
> > > Sure is mate!. Its all in the javabean specs
> > >
> > > This post should enlighten you further:
> > >
> > > http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> > >
> > >
> > > And for another getter/setter 'gotcha' you can read this 
> > thread through
> > >
> > > http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> > >
> > > hth
> > > Andrew
> > >
> > > Vinod Easaw Varghese wrote:
> > > > Hi,
> > > >
> > > > I have a textbox in a JSP whose property has been 
> > named as eCoupon.
> > > > I have created the necessary ActionForm with the 
> > necessary setter and
> > > > getter methods such as setECoupon and getECoupon.
> > > > When I run submit the form within the corresponding 
> > JSP I get the
> > > > error message not able to find the corresponding getter method for
> > > > property eCoupon
> > > > The moment I changed the property name to ecoupon and made the
> > > > necessary adjustments within the ActionForm all began to 
> > work well.
> > > >
> > > > Is there a property naming convention to be followed in STRUTS
> > > >
> > > >
> > > > With thanks and Regards
> > > >
> > > > Vinod Easaw Varghese

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ??? property naming convention problem

2004-12-14 Thread Jim Barrows


> -Original Message-
> From: Kris Schneider [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 10:45 AM
> To: Struts Users Mailing List
> Subject: RE: ??? property naming convention problem
> 
> 
> Quoting Jim Barrows <[EMAIL PROTECTED]>:
> 
> > > -Original Message-
> > > From: Daniel Perry [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, December 14, 2004 7:52 AM
> > > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > > Subject: RE: ??? property naming convention problem
> > > 
> > > 
> > > This is confusing.  The bean spec / article is talking about 
> > > going from a
> > > method name into a property name.  The problem here is the 
> > > other way round.
> > 
> > WHat's confusing?  Bean property names must begin with 
> lowercase first
> > letter.  Getters and Setters capitalize this.
> > I've never had this issue.  properties are always eCoupon 
> and setECoupon and
> > getEcoupon.
> 
> Actually, no. It's perfectly legal for a property name to 
> begin with an upper
> case letter. Again, see:
> 
> http://wiki.apache.org/struts/JavaBeans

I see your specification and raise you the coding style: 
http://java.sun.com/docs/codeconv/html/CodeConventions.doc8.html#367

Variables


Except for variables, all instance, class, and class constants are in mixed 
case with a lowercase first letter. Internal words start with capital letters. 
Variable names should not start with underscore _ or dollar sign $ characters, 
even though both are allowed.

Variable names should be short yet meaningful. The choice of a variable name 
should be mnemonic- that is, designed to indicate to the casual observer the 
intent of its use. One-character variable names should be avoided except for 
temporary "throwaway" variables. Common names for temporary variables are i, j, 
k, m, and n for integers; c, d, and e for characters.


int i;
charc;
float   myWidth;

> 
> > > Eg, decapitalise method->property will convert: 
> getECoupon -> ECoupon
> > > But it doesnt mention property->method capitalise: eCoupon -> 
> > > getECoupon /
> > > geteCoupon
> > > 
> > > I think the assumption has been made that if youre going 
> to go from
> > > getECoupon ->ECoupon that you must go from 
> > > ECoupon->getECoupon and therefore
> > > eCoupon->geteCoupon
> > > 
> > > However the spec doesnt say that this should be a reversible 
> > > process, so why
> > > not eCoupon->getECoupon
> > > 
> > > Daniel.
> > > 
> > > > -Original Message-
> > > > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > > > Sent: 14 December 2004 14:01
> > > > To: Struts Users Mailing List
> > > > Subject: Re: ??? property naming convention problem
> > > >
> > > >
> > > > Sure is mate!. Its all in the javabean specs
> > > >
> > > > This post should enlighten you further:
> > > >
> > > > http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> > > >
> > > >
> > > > And for another getter/setter 'gotcha' you can read this 
> > > thread through
> > > >
> > > > 
http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> > >
> > > hth
> > > Andrew
> > >
> > > Vinod Easaw Varghese wrote:
> > > > Hi,
> > > >
> > > > I have a textbox in a JSP whose property has been 
> > named as eCoupon.
> > > > I have created the necessary ActionForm with the 
> > necessary setter and
> > > > getter methods such as setECoupon and getECoupon.
> > > > When I run submit the form within the corresponding 
> > JSP I get the
> > > > error message not able to find the corresponding getter method for
> > > > property eCoupon
> > > > The moment I changed the property name to ecoupon and made the
> > > > necessary adjustments within the ActionForm all began to 
> > work well.
> > > >
> > > > Is there a property naming convention to be followed in STRUTS
> > > >
> > > >
> > > > With thanks and Regards
> > > >
> > > > Vinod Easaw Varghese

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ??? property naming convention problem

2004-12-14 Thread Kris Schneider
This may be of interest:

http://wiki.apache.org/struts/JavaBeans

Quoting Andrew Hill <[EMAIL PROTECTED]>:

> Yes, it is rather confusing. I wasted *many* hours with this issue the 
> first time it hit me!
> 
> Another poster also stated that putting the property name as "ECoupon" 
> in the JSP would work - and thats because with a getter getECoupon() 
> that IS the real property name (like your saying in the last line of 
> your email).
> 
> Iirc the bean property capitalisation rules - which also cover multiple 
> capital letters in a row - mean there is no equivalant getter for the 
> property "eCoupon", instead its "ECoupon" that maps to the getter 
> "getECoupon". So the fact here is that your _not_ naming your property 
> "eCoupon" - your naming it "ECoupon"! :-)
> 
> (The internal varioable name might be eCoupon, but it could equally well 
> be foo or bob, or anything - it doesnt matter for the determination of 
> the property name and as far as code that works with JavaBeans is 
> concerned that property is called "ECoupon" and not "eCoupon".
> 
> 
> 
> 
> 
> Daniel Perry wrote:
> 
> > This is confusing.  The bean spec / article is talking about going from a
> > method name into a property name.  The problem here is the other way
> round.
> > 
> > Eg, decapitalise method->property will convert: getECoupon -> ECoupon
> > But it doesnt mention property->method capitalise: eCoupon -> getECoupon /
> > geteCoupon
> > 
> > I think the assumption has been made that if youre going to go from
> > getECoupon ->ECoupon that you must go from ECoupon->getECoupon and
> therefore
> > eCoupon->geteCoupon
> > 
> > However the spec doesnt say that this should be a reversible process, so
> why
> > not eCoupon->getECoupon
> > 
> > Daniel.
> > 
> > 
> >>-Original Message-
> >>From: Andrew Hill [mailto:[EMAIL PROTECTED]
> >>Sent: 14 December 2004 14:01
> >>To: Struts Users Mailing List
> >>Subject: Re: ??? property naming convention problem
> >>
> >>
> >>Sure is mate!. Its all in the javabean specs
> >>
> >>This post should enlighten you further:
> >>
> >>http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> >>
> >>
> >>And for another getter/setter 'gotcha' you can read this thread through
> >>
> >>http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> >>
> >>hth
> >>Andrew
> >>
> >>Vinod Easaw Varghese wrote:
> >>
> >>>Hi,
> >>>
> >>>I have a textbox in a JSP whose property has been named as eCoupon.
> >>>I have created the necessary ActionForm with the necessary setter and
> >>>getter methods such as setECoupon and getECoupon.
> >>>When I run submit the form within the corresponding JSP I get the
> >>>error message not able to find the corresponding getter method for
> >>>property eCoupon
> >>>The moment I changed the property name to ecoupon and made the
> >>>necessary adjustments within the ActionForm all began to work well.
> >>>
> >>>Is there a property naming convention to be followed in STRUTS
> >>>
> >>>
> >>>With thanks and Regards
> >>>
> >>>Vinod Easaw Varghese

-- 
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech   <http://www.dotech.com/>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: ??? property naming convention problem

2004-12-14 Thread Jim Barrows
> -Original Message-
> From: Daniel Perry [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, December 14, 2004 7:52 AM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: RE: ??? property naming convention problem
> 
> 
> This is confusing.  The bean spec / article is talking about 
> going from a
> method name into a property name.  The problem here is the 
> other way round.

WHat's confusing?  Bean property names must begin with lowercase first letter.  
Getters and Setters capitalize this.
I've never had this issue.  properties are always eCoupon and setECoupon and 
getEcoupon.

> 
> Eg, decapitalise method->property will convert: getECoupon -> ECoupon
> But it doesnt mention property->method capitalise: eCoupon -> 
> getECoupon /
> geteCoupon
> 
> I think the assumption has been made that if youre going to go from
> getECoupon ->ECoupon that you must go from 
> ECoupon->getECoupon and therefore
> eCoupon->geteCoupon
> 
> However the spec doesnt say that this should be a reversible 
> process, so why
> not eCoupon->getECoupon
> 
> Daniel.
> 
> > -Original Message-
> > From: Andrew Hill [mailto:[EMAIL PROTECTED]
> > Sent: 14 December 2004 14:01
> > To: Struts Users Mailing List
> > Subject: Re: ??? property naming convention problem
> >
> >
> > Sure is mate!. Its all in the javabean specs
> >
> > This post should enlighten you further:
> >
> > http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
> >
> >
> > And for another getter/setter 'gotcha' you can read this 
> thread through
> >
> > http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
> >
> > hth
> > Andrew
> >
> > Vinod Easaw Varghese wrote:
> > > Hi,
> > >
> > > I have a textbox in a JSP whose property has been 
> named as eCoupon.
> > > I have created the necessary ActionForm with the 
> necessary setter and
> > > getter methods such as setECoupon and getECoupon.
> > > When I run submit the form within the corresponding 
> JSP I get the
> > > error message not able to find the corresponding getter method for
> > > property eCoupon
> > > The moment I changed the property name to ecoupon and made the
> > > necessary adjustments within the ActionForm all began to 
> work well.
> > >
> > > Is there a property naming convention to be followed in STRUTS
> > >
> > >
> > > With thanks and Regards
> > >
> > > Vinod Easaw Varghese
> > >
> > >
> > >
> >
> >
> > 
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: ??? property naming convention problem

2004-12-14 Thread Sebastián Gorgo
Vinod Easaw Varghese wrote:
Hi,
 
I have a textbox in a JSP whose property has been named as eCoupon.
I have created the necessary ActionForm with the necessary setter and
getter methods such as setECoupon and getECoupon. 
When I run submit the form within the corresponding JSP I get the
error message not able to find the corresponding getter method for
property eCoupon
The moment I changed the property name to ecoupon and made the
necessary adjustments within the ActionForm all began to work well.

Is there a property naming convention to be followed in STRUTS
 

With thanks and Regards
Vinod Easaw Varghese
 

I had this problem. Try with...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: ??? property naming convention problem

2004-12-14 Thread Daniel Perry
This is confusing.  The bean spec / article is talking about going from a
method name into a property name.  The problem here is the other way round.

Eg, decapitalise method->property will convert: getECoupon -> ECoupon
But it doesnt mention property->method capitalise: eCoupon -> getECoupon /
geteCoupon

I think the assumption has been made that if youre going to go from
getECoupon ->ECoupon that you must go from ECoupon->getECoupon and therefore
eCoupon->geteCoupon

However the spec doesnt say that this should be a reversible process, so why
not eCoupon->getECoupon

Daniel.

> -Original Message-
> From: Andrew Hill [mailto:[EMAIL PROTECTED]
> Sent: 14 December 2004 14:01
> To: Struts Users Mailing List
> Subject: Re: ??? property naming convention problem
>
>
> Sure is mate!. Its all in the javabean specs
>
> This post should enlighten you further:
>
> http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
>
>
> And for another getter/setter 'gotcha' you can read this thread through
>
> http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
>
> hth
> Andrew
>
> Vinod Easaw Varghese wrote:
> > Hi,
> >
> > I have a textbox in a JSP whose property has been named as eCoupon.
> > I have created the necessary ActionForm with the necessary setter and
> > getter methods such as setECoupon and getECoupon.
> > When I run submit the form within the corresponding JSP I get the
> > error message not able to find the corresponding getter method for
> > property eCoupon
> > The moment I changed the property name to ecoupon and made the
> > necessary adjustments within the ActionForm all began to work well.
> >
> > Is there a property naming convention to be followed in STRUTS
> >
> >
> > With thanks and Regards
> >
> > Vinod Easaw Varghese
> >
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: ??? property naming convention problem

2004-12-13 Thread Andrew Hill
Yes, it is rather confusing. I wasted *many* hours with this issue the 
first time it hit me!

Another poster also stated that putting the property name as "ECoupon" 
in the JSP would work - and thats because with a getter getECoupon() 
that IS the real property name (like your saying in the last line of 
your email).

Iirc the bean property capitalisation rules - which also cover multiple 
capital letters in a row - mean there is no equivalant getter for the 
property "eCoupon", instead its "ECoupon" that maps to the getter 
"getECoupon". So the fact here is that your _not_ naming your property 
"eCoupon" - your naming it "ECoupon"! :-)

(The internal varioable name might be eCoupon, but it could equally well 
be foo or bob, or anything - it doesnt matter for the determination of 
the property name and as far as code that works with JavaBeans is 
concerned that property is called "ECoupon" and not "eCoupon".



Daniel Perry wrote:
This is confusing.  The bean spec / article is talking about going from a
method name into a property name.  The problem here is the other way round.
Eg, decapitalise method->property will convert: getECoupon -> ECoupon
But it doesnt mention property->method capitalise: eCoupon -> getECoupon /
geteCoupon
I think the assumption has been made that if youre going to go from
getECoupon ->ECoupon that you must go from ECoupon->getECoupon and therefore
eCoupon->geteCoupon
However the spec doesnt say that this should be a reversible process, so why
not eCoupon->getECoupon
Daniel.

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: 14 December 2004 14:01
To: Struts Users Mailing List
Subject: Re: ??? property naming convention problem
Sure is mate!. Its all in the javabean specs
This post should enlighten you further:
http://marc.theaimsgroup.com/?l=struts-user&m=98900256403524&w=2
And for another getter/setter 'gotcha' you can read this thread through
http://marc.theaimsgroup.com/?l=struts-user&m=102696975022454&w=2
hth
Andrew
Vinod Easaw Varghese wrote:
Hi,
   I have a textbox in a JSP whose property has been named as eCoupon.
I have created the necessary ActionForm with the necessary setter and
getter methods such as setECoupon and getECoupon.
   When I run submit the form within the corresponding JSP I get the
error message not able to find the corresponding getter method for
property eCoupon
   The moment I changed the property name to ecoupon and made the
necessary adjustments within the ActionForm all began to work well.
Is there a property naming convention to be followed in STRUTS
With thanks and Regards
Vinod Easaw Varghese


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]