tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francisco Areas Guimaraes" <far...@larc.usp.br>
Subject Re: Tomcat/JSP Question
Date Fri, 01 Jun 2001 22:22:44 GMT
I could be wrong, but 'int' is a primitive type, I donĀ“t know if it extends
Object, have you tried 'Integer my_object = EX.myObject' ?

Francisco

----- Original Message -----
From: "Mike Alba" <malba@mobliss.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Friday, June 01, 2001 7:17 PM
Subject: Re: Tomcat/JSP Question


> Actually I was wondering if you can do this
>
> Class Example
> {
>
>   public Object myObject;
>
>   public Example()
>   {
>      this.myObject = new myObject();
>   } // end constructor
>
> }
>
> then acess it via my JSP
>
> <jsp:useBean id = "EX" class = "Example" scope = "session" />
> <% int my_object = EX.myObject %>
>
> It says that this doesnt exist? Is there no way
> to do this?
>
> Thanks so much for your help!
>
> Mike
>
> ----- Original Message -----
> From: "Purcell, Scott" <spurcell@ltcgroup.com>
> To: <tomcat-user@jakarta.apache.org>
> Sent: Friday, June 01, 2001 12:47 PM
> Subject: RE: Tomcat/JSP Question
>
>
> > I think you may have the syntax for
> >   jsp:get_property
> >   jsp:set_property
> > wrong.
> > It is jsp:getProperty()
> > and jsp:setProperty()
> >
> > Here is a textbook example from Fields and Kolbs book. Hope it helps
> > #JSP
> >
> > <% page import = "com.taglib.wdjsp.components.CompoundIntrestBean" %>
> > <jsp:useBean id="calculator" class="CompoundInterestBean" />
> > <jsp:setProperty name="calculator" property="principal" />
> > </jsp:useBean>
> > <jsp:getProperty name="calculator" property="principal" />
> >
> > Hope that helps,
> > Scott
> >
> >
> >
> >
> > -----Original Message-----
> > From: Mike Alba [mailto:malba@mobliss.com]
> > Sent: Friday, June 01, 2001 2:47 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Tomcat/JSP Question
> >
> >
> > Hi,
> >
> >   Forgive me for the beginner question but I am trying to
> > instantiate a class for a JSP.
> > I am using:
> > <jsp:useBean id = "EX" class = "Example" scope = "session" />
> >
> > Thus I am under the assumption that my "Example" class is being
> > instantiated and the constructor is called, is this incorrect?
> > Basically I am trying to instantiate a class for a session and
> > was wondering if this is the way to do it.
> > And so if it is can I access class objects, I am assuming
> > I am supposed to use
> >   jsp:get_property
> >   jsp:set_property
> >
> > rather then EX.counter
> > where counter is a property of the "Example class"
> >
> > Once again sorry for the newbie question
> > and thanks for any help you can give!!
> >
> > Mike
> >
>
>


Mime
View raw message