You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ralph Einfeldt <ra...@uptime-isc.de> on 2000/11/15 17:32:11 UTC

AW: Accessing Beans; was: aaargh..

You are mixing to different things.

<jsp:setProperty/> works on beans.
In JSP beans have to be declared and created
with the <jsp:useBean/> tag.

So your p is not a bean to JSP. To change
this you have to use the <jsp:useBean/> tag.
Otherwise the only way to access it, is to 
use it in expressions <%= p.someMethod() %> or 
scriptlets <% p.anotherMethod(); %>

> -----Ursprüngliche Nachricht-----
> Von: Alexander ten Bruggencate [mailto:a.ten.bruggencate@home.nl]
> Gesendet: Mittwoch, 15. November 2000 16:58
> An: tomcat-user
> Betreff: aaargh..
<snip/>
> the only problem is that <jsp:setProperty ..../> and <jsp:getProperty
> ..../> won't work.
<snip/>
> part of the jsp file:
> <%
> nl.step.stepdb.person.interfaces.Person p;
> p = pbrowse.createUser();
> %>
<snip/>

Re: AW: Accessing Beans; was: aaargh..

Posted by Alexander ten Bruggencate <a....@home.nl>.
Ralph Einfeldt wrote:

> You are mixing to different things.
>
> <jsp:setProperty/> works on beans.
> In JSP beans have to be declared and created
> with the <jsp:useBean/> tag.
>
> So your p is not a bean to JSP. To change
> this you have to use the <jsp:useBean/> tag.
> Otherwise the only way to access it, is to
> use it in expressions <%= p.someMethod() %> or
> scriptlets <% p.anotherMethod(); %>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Alexander ten Bruggencate [mailto:a.ten.bruggencate@home.nl]
> > Gesendet: Mittwoch, 15. November 2000 16:58
> > An: tomcat-user
> > Betreff: aaargh..
> <snip/>
> > the only problem is that <jsp:setProperty ..../> and <jsp:getProperty
> > ..../> won't work.
> <snip/>
> > part of the jsp file:
> > <%
> > nl.step.stepdb.person.interfaces.Person p;
> > p = pbrowse.createUser();
> > %>
> <snip/>

Hi,

thank you for that explanation,  i'm beginning to see the light...also
because william brogden replied to my orginal mail. ^_^

Although i still think it's strange that i have to use the useBean tag.

for example can i call different constructors of  the same bean with the
useBean tag?

-Alexander.