I typed in my first example servlet today & cannot seem to get it working.
I made sure all the following were done:
1) Classpath is set
CATALINA_HOME=$CATALINA_HOME:/usr/java/jakarta-tomcat-4.0.4
JAVA_HOME=/usr/java/j2sdk1.4.0
PATH=$PATH:$HOME/bin:/usr/java/j2sdk1.4.0/bin
CLASSPATH=$CLASSPATH:/home/lfindle/java:/usr/java/jakarta-tomcat-4.0.4/commo
n/lib/servlet.jar:.
export CATALINA_HOME
export JAVA_HOME
export PATH
export CLASSPATH
2) Put the servlet in
/usr/java/usr/java/jakarta-tomcat-4.0.4/webapps/begjsp-ch01/WEB-INF/classes/
ExampleServlet.java
Compiled it from there. Shutdown & restarted Tomcat.
I went to http://localhost:8080/begjsp-ch01/servlet/ExampleServlet & get 404
Error message.
Does anyone have any suggestions?
Thanks.
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ExampleServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out;
String title = "Servlet Example";
response.setContentType("text/html");
out = response.getWriter();
out.println("<html><head><title>");
out.println(title);
out.println("</title></head><body>");
out.println("<h1>This is an example servlet.</h1>");
out.println("</body></html>");
out.close();
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException{
doGet(request, response);
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>