What do you mean where it's located. The class file located under
tomcat/../web-inf/classes, java file located in your file directory which
has your IDE mounted on it.
The object (after you instatntiate) locates on the jsp, you can do what ever
you like on it, you need to import the package
use <%@ page import="com.sug.consumer.model.*" %>
<% car mycar=new car();
car.doSomething(); %> makes no difference from
<% HashMap myCars = new HashMap()
myCars.put("beetle", "$16000"); %>
you certainly need <%@ page import="java.util.*" %> to get it run. So you
need to specify what do you mean locate. Every object that you created on a
jsp is on the jsp. All the source and class file is somewhere on your
machine.
Dawei
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Scott Fitzgerald
Sent: Thursday, February 15, 2001 9:53 AM
To: [EMAIL PROTECTED]
Subject: Re: Using objects in JSPs (newbie)
On 15 Feb 2001, at 9:38, Joseph Ottinger wrote:
> Look at http://java.sun.com/products/jsp, and read the tutorial, for one
> thing.
>
I have looked at that and what i wanted wasn't there!
> There are a few ways to do it, depending on what your needs and desires
are.
> For example:
>
> <% car mycar=new car();
> car.doSomething(); %>
I know how to do this, but where is the above 'car object located?
>
> or the more appropriate
>
> <jsp:useBean id="car" scope="request" type="car" />
I dont want to use a bean!
>
>
> >From: Scott Fitzgerald <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server Pages specification and
> > reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Using objects in JSPs (newbie)
> >Date: Thu, 15 Feb 2001 13:51:30 +0000
> >
> >Hi,
> >How would I go about using an object called car, for example, in a
> >JSP. I have written the object and saved it in its own file called
> >car.java. How do I access this object and its methods from a jsp?
> >
> >Thanks,
> >Scott
> >
>
>===========================================================================
> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> >DIGEST".
> >Some relevant FAQs on JSP/Servlets can be found at:
> >
> > http://java.sun.com/products/jsp/faq.html
> > http://www.esperanto.org.nz/jsp/jspfaq.html
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets