> De: Nicolas De Loof
> Struts builds getter methods call with the property name by
> adding "get" and
> upperCased first char.

I've an example with one property that start with only one lower case
character, something like this pProperty and I always get the same error, "
can't fing get method for property pProperty ".

Some time later, i noticed that in JSP a have to write porperty PProperty
instead pProperty .

Is this a bug or it's ok????

Regards, Enrique.

PS: I attach an example of it.

_____________________________
Enrique Rodriguez Lasterra






>
So you can call a "getPassword" method from a
> "password" property declaration (in JSP), even if the underlying attribute
> is
> private String this_is_not_password_but_anything_else;
>
> so that's ok, you can call your property the way you want, but
> for the logic
> of your presentation layer, you WOULD use the same name for
> property in JSP
> tags and its associated attribute.
>
> If you want to disconnect your bean from presentation datas, it would be
> better to consider using a thin wrapper object whith "getPasword" and
> "setpassword", maintaining the "userPassword" attribute of your data bean.
>
>
> Thanks for the replies.  Does anybody else have an opinion as to which is
> right?
>
> Thanks.
>
> Jose Casas
>
> E-Commerce Applications
> (501) 277-3112
> [EMAIL PROTECTED]
>
>
>
> > -----Original Message-----
> > From: Jim Crossley [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, March 26, 2002 9:10 AM
> > To: Struts Users Mailing List; [EMAIL PROTECTED]
> > Subject: Re: AW: struts get and set methods in formbeans
> >
> > 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é <[EMAIL PROTECTED]> 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:[EMAIL PROTECTED]]
> > > 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:
> > > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
<%@page contentType="text/html"%>
<%@ taglib uri="/WEB-INF/struts-html.tld"
        prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld"
        prefix="bean" %>

<html:html>
<head>
<title>
   <bean:write name="Bean" property="PProperty"/>
</title>


</head>

<h1><bean:write name="Bean" property="PProperty"/></H1>

<html:errors/>
</html:html>

Attachment: Bean.java
Description: Binary data

Attachment: ExamplePropertyAction.java
Description: Binary data

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

Reply via email to