Creating a new class instance from a servlet

D

Damo

Hi,
I have a servlet and and trying to instantiate a class in the servlet.
I'm using the following code:
engine e = new engine();
The engine class compiles without error but when i compile the servlet
i get 2 errors from this line cannot find symbol. Anyone know what the
problem might be?
Thanks
 
M

Manish Pandit

The engine class compiles without error but when i compile the servlet
i get 2 errors from this line cannot find symbol. Anyone know what the
problem might be?

Did you import the correct package? Is the class accessible to the
servlet?

-cheers,
Manish
 
D

Damo

the servlet is in the classes folder in a package called Search and the
class i'm trying to instantiate is in Search.model , but it cant find
it. i am importing the search.model folder
thanks
 
I

itreflects

Damo said:
the servlet is in the classes folder in a package called Search and the
class i'm trying to instantiate is in Search.model , but it cant find
it. i am importing the search.model folder
thanks

try this:

Search.model.engine e = new Search.model.engine();

and make sure Search.model.engine class is there in runtime CLASSPATH.
hope it helps.
 
T

trippy

Damo took the hamburger meat, threw it on the grill, and I said "Oh
Wow"...
Hi,
I have a servlet and and trying to instantiate a class in the servlet.
I'm using the following code:
engine e = new engine();
The engine class compiles without error but when i compile the servlet
i get 2 errors from this line cannot find symbol. Anyone know what the
problem might be?

Engine e = new Engine(); ?

Just a guess, since you didn't post the error message.

--
trippy
mhm31x9 Smeeter#29 WSD#30
sTaRShInE_mOOnBeAm aT HoTmAil dOt CoM

NP: "All I Really Want" -- Alanis Morissette

"Now, technology's getting better all the time and that's fine,
but most of the time all you need is a stick of gum, a pocketknife,
and a smile."

-- Robert Redford "Spy Game"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top