You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bjørn T Johansen <bt...@havleik.no> on 2003/05/18 18:29:17 UTC

No getter method for property Userdata of bean UserCont.??

I have a problem I can't seem to figure out. I am trying to access a
bean from a jsp page like this:

<bean:write name="UserCont" scope="session"  property="Userdata.Fornavn"
/>

where UserCont is a java class with private variable called
Userdata,another Java class, and the UserCont class clearly has public
methods for both getUserdata and setUserdata. (as well as that method in
Userdata called getFornavn exist).

The UserCont class is placed in the session context with 
session.setAttribute("UserCont", existingCont) in an action class.

I can't see why this is not working, am I just bind or is it something I
am missing?


Regards,

BTJ

-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen (BSc,MNIF)
Executive Manager
btj@havleik.no                  Havleik Consulting
Phone : +47 67 54 15 17         Conradisvei 4
Fax : +47 67 54 13 91           N-1338 Sandvika
Cellular : +47 926 93 298       http://www.havleik.no
-----------------------------------------------------------------------------------------------
"The stickers on the side of the box said "Supported Platforms: Windows
98, Windows NT 4.0,
Windows 2000 or better", so clearly Linux was a supported platform."
-----------------------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: No getter method for property Userdata of bean UserCont.??

Posted by Bjørn T Johansen <bt...@havleik.no>.
Hmmm, that helped, thanks... :)

But why doesn't Struts see the method when I use the right case?


BTJ

On Sun, 2003-05-18 at 18:40, Robert Taylor wrote:
> Try,
> 
> <bean:write name="UserCont" scope="session"  property="userdata.fornavn"/>
> 
> 
> You should try and stick to conventional naming. For example, Userdata
> should be called userdata or userData.
> 
> Also make sure your  classes stick to the JavaBean spec for naming.
> http://java.sun.com/products/javabeans/docs/spec.html
> 
> 
> hth,
> 
> robert
> 
> > -----Original Message-----
> > From: Bjørn T Johansen [mailto:btj@havleik.no]
> > Sent: Sunday, May 18, 2003 12:29 PM
> > To: Struts Users Mailing List
> > Subject: No getter method for property Userdata of bean UserCont.??
> >
> >
> > I have a problem I can't seem to figure out. I am trying to access a
> > bean from a jsp page like this:
> >
> > <bean:write name="UserCont" scope="session"  property="Userdata.Fornavn"
> > />
> >
> > where UserCont is a java class with private variable called
> > Userdata,another Java class, and the UserCont class clearly has public
> > methods for both getUserdata and setUserdata. (as well as that method in
> > Userdata called getFornavn exist).
> >
> > The UserCont class is placed in the session context with
> > session.setAttribute("UserCont", existingCont) in an action class.
> >
> > I can't see why this is not working, am I just bind or is it something I
> > am missing?
> >
> >
> > Regards,
> >
> > BTJ
> >
> > --
> > ------------------------------------------------------------------
> > -----------------------------
> > Bjørn T Johansen (BSc,MNIF)
> > Executive Manager
> > btj@havleik.no                  Havleik Consulting
> > Phone : +47 67 54 15 17         Conradisvei 4
> > Fax : +47 67 54 13 91           N-1338 Sandvika
> > Cellular : +47 926 93 298       http://www.havleik.no
> > ------------------------------------------------------------------
> > -----------------------------
> > "The stickers on the side of the box said "Supported Platforms: Windows
> > 98, Windows NT 4.0,
> > Windows 2000 or better", so clearly Linux was a supported platform."
> > ------------------------------------------------------------------
> > -----------------------------
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
-- 
-----------------------------------------------------------------------------------------------
Bjørn T Johansen (BSc,MNIF)
Executive Manager
btj@havleik.no                  Havleik Consulting
Phone : +47 67 54 15 17         Conradisvei 4
Fax : +47 67 54 13 91           N-1338 Sandvika
Cellular : +47 926 93 298       http://www.havleik.no
-----------------------------------------------------------------------------------------------
"The stickers on the side of the box said "Supported Platforms: Windows
98, Windows NT 4.0,
Windows 2000 or better", so clearly Linux was a supported platform."
-----------------------------------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: No getter method for property Userdata of bean UserCont.??

Posted by Robert Taylor <rt...@mulework.com>.
Try,

<bean:write name="UserCont" scope="session"  property="userdata.fornavn"/>


You should try and stick to conventional naming. For example, Userdata
should be called userdata or userData.

Also make sure your  classes stick to the JavaBean spec for naming.
http://java.sun.com/products/javabeans/docs/spec.html


hth,

robert

> -----Original Message-----
> From: Bjørn T Johansen [mailto:btj@havleik.no]
> Sent: Sunday, May 18, 2003 12:29 PM
> To: Struts Users Mailing List
> Subject: No getter method for property Userdata of bean UserCont.??
>
>
> I have a problem I can't seem to figure out. I am trying to access a
> bean from a jsp page like this:
>
> <bean:write name="UserCont" scope="session"  property="Userdata.Fornavn"
> />
>
> where UserCont is a java class with private variable called
> Userdata,another Java class, and the UserCont class clearly has public
> methods for both getUserdata and setUserdata. (as well as that method in
> Userdata called getFornavn exist).
>
> The UserCont class is placed in the session context with
> session.setAttribute("UserCont", existingCont) in an action class.
>
> I can't see why this is not working, am I just bind or is it something I
> am missing?
>
>
> Regards,
>
> BTJ
>
> --
> ------------------------------------------------------------------
> -----------------------------
> Bjørn T Johansen (BSc,MNIF)
> Executive Manager
> btj@havleik.no                  Havleik Consulting
> Phone : +47 67 54 15 17         Conradisvei 4
> Fax : +47 67 54 13 91           N-1338 Sandvika
> Cellular : +47 926 93 298       http://www.havleik.no
> ------------------------------------------------------------------
> -----------------------------
> "The stickers on the side of the box said "Supported Platforms: Windows
> 98, Windows NT 4.0,
> Windows 2000 or better", so clearly Linux was a supported platform."
> ------------------------------------------------------------------
> -----------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org