i made a Servlet class ServletHome.java which work only transfer the control to Vij.jsp. Vij.jsp in turn call a another jsp file Indus.jsp. this jsp transfer the control to another servlet class ServletOne.java which perform
some business logic on some java classes then dispaly the result on same jsp file Indus.jsp from where i called ServletOne.java
i am configuring web.xml.but due to some mistake in web.xml, i am founding exception.
I really should have a handy cut and paste to say this since it is a common beginner error for people moving from desktop applications to a container hosted environment.
ALL classes in servlets should be in named packages and the class files stored accordingly.
What you have there is a class in the "default" package - a JVM will look for it in the "current" directory. You have no control over the current directory therefore the class is never loaded.
i placed all servlet classes in a servlet folder under E:\Webproject\WEB-INF\classes
i also placed vij folder under servlet class. vij folder have some java classes. one servlet use this java classes. if i did not place the vij folder under servlet folder one servlet are not compile.
so root for servlets classes is:
root for java classes is:
I do suggest you to *google* about web application structure and make a *Hello World* Servlet
current directory is Webproject
No, you have little to no control over what a servlet container thinks is the "current" directory.
you should become familiar with the official servlet API and the directory structure requirements. Why not start at this Sun/Oracle site instead of flailing around.
Seetharaman Venkatasamy wrote: it must be
Yes, except that I think an incorrect value has been used for the servlet class, so I don't think servlet is actually the package name for the class file - instead, I think the poster placed the url pattern into this field by mistake. I think the poster still doesn't understand the need for packages, or doesn't understand what they are.
Seetharaman Venkatasamy wrote:I do suggest you to *google* about web application structure and make a *Hello World* Servlet
That's good advice. There's good 'getting started' help in the ServletsFaq on the Ranch.