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.2 7\webapps\ examples\W EB-INF\cla sses"
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
"C:\Program Files\jakarta-tomcat-4.1.2
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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/class es
that should do it...so long as your class isnt inside a package...
Tim.
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/class
that should do it...so long as your class isnt inside a package...
Tim.
ASKER
Thank you for the explaination.
:-)
ASKER
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