I'm doing a Grad Dip in IT, but it doesn't cover
J2EE so I want to teach myself. I borrowed "Java for the Web with
Servlets,
JSP, and EJB" and thought, "Beaut, I'll just work my way through this and I'll have a good basic understanding of J2EE". Unfortunately, even though I have got
Tomcat 4.1 working (I decided to use that since the book is 2002), for some unknown reason, when I try to call my servlet from Firefox (localhost:8080 etc) I get an error message: "The requested resource (/myApp/servlet/TestingServlet) is not available". This is the servlet code:
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class TestingServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>Servlet
Testing</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("Welcome to the Servlet Testing Center");
out.println("</BODY>");
out.println("</HTML>");
}
}
I must have everything set up OK as the example servlets that come with Tomcat work fine. Any ideas?