This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Basic Servlet Question" Watch "Basic Servlet Question" New topic
Author

Basic Servlet Question

Madhu SK
Greenhorn

Joined: May 07, 2001
Posts: 12
Hi,
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.
\MyServlets\Web-inf\classes\HelloWorldServlet.class.
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
Greenhorn

Joined: May 07, 2001
Posts: 12
Thanks..it is working now
 
 
subject: Basic Servlet Question