Link to home
Start Free TrialLog in
Avatar of rnavanee
rnavanee

asked on

Servlet help needed

I have the a.java and a.class file in this path
"C:\Program Files\jakarta-tomcat-4.1.27\webapps\examples\WEB-INF\classes"

I have installed Tomcat 1.4.27. I used the following link in my browser:
"http://localhost:8080/examples/servlet/a"

It is working as expected.
But my doubt is, there is no folder named "servlet" under "examples" folder. Instead a folder named "servlets" is only seen within "examples" folder. When i tried "http://localhost:8080/examples/servlets/a" link it is returning 404 error.

I don't understand the process. Please help me.


Thanks,
Navanee

ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rnavanee
rnavanee

ASKER

Ok. I got it.

But there are lot of folders under the "webapps" folder. Can anyone explain them in detail. I get confused while dealing with these folders. I don't know where to place the servlet source code, JSP code ...

Thanks again
ROOT is set up as the default pages; ie:

http://localhost/index.html

will be inside ROOT

the others are the other webapps that come with tomcat:

http://localhost/examples/index.html

is inside the examples webapp

if you look inside server.xml (in the conf directory), you can see how these are set up for logging, etc

If you want your servlet to run as:

http://localhost/servlet/MyServlet

then put the class for your servlet in

webapps/ROOT/WEB-INF/classes

that should do it...so long as your class isnt inside a package...

Tim.
Thank you for the explaination.