Simplest servlet possible...what am I doing wrong

Take this simple servlet:

import java.io.*;

import javax.servlet.*;

import javax.servlet.http.*;

public class SimpleCounter extends HttpServlet {

int count = 0;

public void doGet(HttpServletRequest req, HttpServletResponse res)

throws ServletException, IOException {

res.setContentType("text/plain");

PrintWriter out = res.getWriter();

count++;

out.println("Since loading, this servlet has been accessed " +

count + " times.");

}

}

I copied this in tomcat/webapps/Root/Web-inf/classes and in the browser I wrote localhost:8080/servlet/SimpleCounter ....I get: The requested resource (/servlet/SimpleCounter) is not available.

I have jdk1.5.0 and Tomcat 5.0.28...when I type localhost:8080 I get the standard tomcat page..so it's installed corectly...if I run the example servlets they also work so I guess everything is ok from my point of view. The servlet that I copied works because it's taken from a site where I tried it and it worked. So why doesn't it work for me? If I compile this with javac I get the Exception in tread main error. So..anyone can tell me what am I doing wrong? 10x

[1197 byte] By [Biggie_maca] at [2007-10-2 15:56:21]
# 1

Running a servlet involves more than just dropping the class into Tomcat. You need to do some configuration to tell the Tomcat about your servlet.

Have a look at the following short tutorial for what needs to be done:

http://www-128.ibm.com/developerworks/edu/j-dw-java-intserv-i.html

craigcaulfielda at 2007-7-13 16:15:40 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...