You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jose Casas <Jo...@wal-mart.com> on 2002/03/26 15:41:54 UTC

struts get and set methods in formbeans

Hello,

I got a question about the get and set methods in the form beans.  Does the
get or set method need to have the name of the member variable in it?
For example, if I have a member variable named userPassword do I have to
have a get/set method called getuserPassword/setuserPassword or can I put
getPassword/setPassword.  I guess what I'm asking is does the variable have
to appear exactly the same in the get/set method.

Thank you.



**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to 
whom they are addressed.  If you have received this email
in error destroy it immediately.
**********************************************************************


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


Re: AW: struts get and set methods in formbeans

Posted by Jim Crossley <jc...@ifleet.com>.
I don't think that's correct.  As long as you refer to the "password"
property in your JSP, you may use getPassword/setPassword, regardless
of the name of the data member they encapsulate.

In other words, it's not the name of the private data member that
determines the names of your public accessors.  It's the name used in
your JSP's.

-- Jim

Oliver Reflé <o....@gmx.de> writes:

> Yes it has to be the same, if you have "test" you have to implement
> getTest() and setTest()
> 
> -----Ursprüngliche Nachricht-----
> Von: Jose Casas [mailto:Jose.Casas@wal-mart.com]
> Gesendet: Dienstag, 26. März 2002 15:42
> An: 'Struts Users Mailing List'
> Betreff: struts get and set methods in formbeans
> 
> 
> Hello,
> 
> I got a question about the get and set methods in the form beans.  Does the
> get or set method need to have the name of the member variable in it?
> For example, if I have a member variable named userPassword do I have to
> have a get/set method called getuserPassword/setuserPassword or can I put
> getPassword/setPassword.  I guess what I'm asking is does the variable have
> to appear exactly the same in the get/set method.
> 
> Thank you.
> 
> 
> 
> **********************************************************************
> This email and any files transmitted with it are confidential
> and intended solely for the individual or entity to
> whom they are addressed.  If you have received this email
> in error destroy it immediately.
> **********************************************************************
> 
> 
> --
> 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>

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


AW: struts get and set methods in formbeans

Posted by Oliver Reflé <o....@gmx.de>.
Yes it has to be the same, if you have "test" you have to implement
getTest() and setTest()

-----Ursprüngliche Nachricht-----
Von: Jose Casas [mailto:Jose.Casas@wal-mart.com]
Gesendet: Dienstag, 26. März 2002 15:42
An: 'Struts Users Mailing List'
Betreff: struts get and set methods in formbeans


Hello,

I got a question about the get and set methods in the form beans.  Does the
get or set method need to have the name of the member variable in it?
For example, if I have a member variable named userPassword do I have to
have a get/set method called getuserPassword/setuserPassword or can I put
getPassword/setPassword.  I guess what I'm asking is does the variable have
to appear exactly the same in the get/set method.

Thank you.



**********************************************************************
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to
whom they are addressed.  If you have received this email
in error destroy it immediately.
**********************************************************************


--
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>