RE: Tomcat/JSP Question

2001-06-01 Thread Skidmore, Walt
Title: RE: Tomcat/JSP Question





Try putting in get/set methods for the object, then getting them that way, e.g.:


--
public Object getMyObject()
{
    return myObject;
}


public void setMyObject(Object _o)
{
    myObject = _o;
}


<% Object myObject = EX.getMyObject(); %>
--


The get/set methods will allow introspection.


Or, if you want to just get it directly, you need to have a semicolon on the end, like this:


--
<% Object myObject = EX.myObject; %>
--


For regular code in the jsp, you need to enclose it in <% %> and follow regular syntax rules.  If your bean had a String property, you could get it this way:

--
<%=EX.myString%>
--


The <%= %> is shorthand for <% out.print( );%>.


Kinda confusing at first, but you get used to it.  Hope this helps...


-Original Message-
From: Mike Alba [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 3:26 PM
To: [EMAIL PROTECTED]
Subject: Re: Tomcat/JSP Question



Oops it is supposed to be


<% Object myObject = EX.myObject %>
- Original Message -
From: "Francisco Areas Guimaraes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 01, 2001 3:22 PM
Subject: Re: Tomcat/JSP Question



> 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
> >
> > 
> > <% 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" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > 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" %>
> > > 
> > > 
> > > 
> > > 
> > >
> > > Hope that helps,
> > > Scott
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: Mike Alba [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 01, 2001 2:47 PM
> > > To: [EMAIL PROTECTED]
> > > 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:
> > > 
> > >
> > > 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
> > >
> >
> >
>





Re: Tomcat/JSP Question

2001-06-01 Thread Mike Alba

Oops it is supposed to be

<% Object myObject = EX.myObject %>
- Original Message -
From: "Francisco Areas Guimaraes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 01, 2001 3:22 PM
Subject: Re: Tomcat/JSP Question


> 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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
> >
> > 
> > <% 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" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > 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" %>
> > > 
> > > 
> > > 
> > > 
> > >
> > > Hope that helps,
> > > Scott
> > >
> > >
> > >
> > >
> > > -Original Message-
> > > From: Mike Alba [mailto:[EMAIL PROTECTED]]
> > > Sent: Friday, June 01, 2001 2:47 PM
> > > To: [EMAIL PROTECTED]
> > > 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:
> > > 
> > >
> > > 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
> > >
> >
> >
>




Re: Tomcat/JSP Question

2001-06-01 Thread Francisco Areas Guimaraes

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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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
>
> 
> <% 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" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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" %>
> > 
> > 
> > 
> > 
> >
> > Hope that helps,
> > Scott
> >
> >
> >
> >
> > -Original Message-
> > From: Mike Alba [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 01, 2001 2:47 PM
> > To: [EMAIL PROTECTED]
> > 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:
> > 
> >
> > 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
> >
>
>




Re: Tomcat/JSP Question

2001-06-01 Thread Mike Alba

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


<% 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" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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" %>
> 
> 
> 
> 
>  
> Hope that helps,
> Scott
>  
>  
>  
> 
> -Original Message-
> From: Mike Alba [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 01, 2001 2:47 PM
> To: [EMAIL PROTECTED]
> 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:
> 
> 
> 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
> 




RE: Tomcat/JSP Question

2001-06-01 Thread Purcell, Scott

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




 
Hope that helps,
Scott
 
 
 

-Original Message-
From: Mike Alba [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 01, 2001 2:47 PM
To: [EMAIL PROTECTED]
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:


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




Tomcat/JSP Question

2001-06-01 Thread Mike Alba



Hi,
 
  Forgive me for the beginner question but I 
am trying to 
instantiate a class for a JSP.
I am using:


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