File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Basic Servlet Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Basic Servlet Question" Watch "Basic Servlet Question" New topic

Basic Servlet Question

Madhu SK

Joined: May 07, 2001
Posts: 12
I am using Tomcat standalone. I created a servlet called HelloClientServlet. In the Tomcat\WebApps directory, I created the following directory structure and put the class file in it.
How should I run this servlet? Are there any other files that I need to create?
I am able to run all the examples that come with Tomcat & Sun's tutorial without any problem. But I am not able to run my servlets.
Thank You,
Madhu SK
ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
Hi there!
Since you are new to this thing here is something to try out:
a) Put your servlet class in ...webapps\ROOT\WEB-INF\classes
b) Luanch it using http://localhost:8080/servlet/HelloWorldServlet
This should invoke the servlet and you will see some text on the browser so long as your servlet can write out data onto the screen. Then after that you can experiment with virtual contexts.
Good luck

In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Madhu SK

Joined: May 07, 2001
Posts: 12 is working now
I agree. Here's the link:
subject: Basic Servlet Question
It's not a secret anymore!