aruna sameera wrote:there are no pacage statement but still not working?
That's what Bauke is pointing out. Put your servlet into a package and then change the web.xml to reflect the complete i.e. fully qualified name of the servlet class...
Joined: Feb 22, 2009
I had that same problem with my JSP page. It worked when I put my beans in a package.
Author and all-around good cowpoke
Joined: Mar 22, 2000
The reason is that if the JVM trys to load a class not in a package, it looks in the "current" directory. In the servlet environment you have no control over the "current" directory, therefore ALL classes used in servlets MUST be in packages to avoid strange errors.
There are environments wherein packageless servlets work (combination of certain appserver implementation/version and certain JVM implementation/version), but you should never make your application dependent on that. Put classes in packages, period. Only then the other classes can import them.