I have stored the bean class in the destination derictory of my server from where my jsp page locates it and for that i had to make my beans as a packaged one
like this adding this line before import statements of my bean
because my bean is in sub-directory of sunexapmples which is beans and my bean class resides there
Now If i want to use the same bean class in side my servlet I am giving its full path name but it is not able to locate it
I tried calling it through this way
sunexamples.beans.mybean b = new sunexamples.beans.mybean();
and this way also
classes.sunexamples.beans.mybean b =
but compiler is not able to locate it
Im totally confused how to access my bean through servlet
actually I am using javawebserver2.0
this bean is in directory
I am trying to import the package sunexamples.beans
like import classes.sunexamples.beans; or
then it says cannot resolve symbol beans (compiler error)
I tried setting my classpath by adding a line in front of existing classpath like this
(I m using Windows NT)
still nothing seems to work
Originally posted by Andrew Shafer:
Sounds like a classpath problem.
Make sure the directory containing sunexamples is in the classpath for the servlet container.
Also in your servlet, you can import your package. Then you won't need to reference yourbean by the whole package name everytime.