From: net 1 <net...@ho...> - 2004-06-01 07:43:14
|
I have the servlet Contatore.java with the following path: C:\Programmi\Apache Software Foundation\Tomcat 5.0\webapps\Contatore\WEB-INF\classes\contatore_01 I use winXp pro and Tomcat 5.0 Contatore.class is 1.60 KB. With NetBeans The url is http://localhost:8084/contatore/contatore_01/Contatore using tomcat withoput NetBean the url is http://localhost:8080/contatore/contatore_01/Contatore In both the 2 cases the same error when I execute the servlet I have the error from tomcat: HTTP Status 404 - /contatore/contatore_01/Contatore -------------------------------------------------------------------------------- type Status report message /contatore/contatore_01/Contatore description The requested resource (/contatore/contatore_01/Contatore) is not available. -------------------------------------------------------------------------------- Apache Tomcat/5.0.19 here the program Contatore,java package contatore_01; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class Contatore extends HttpServlet { private int conta; public void init(ServletConfig config) throws ServletException { conta = 0; } public void doGet(HttpServletRequest richiesta, HttpServletResponse risposta) throws IOException, ServletException { conta++; risposta.setContentType("text/html"); PrintWriter out = risposta.getWriter(); out.println("<html>"); out.println("<head>"); out.println("<title>Pagina con contatore</title>"); out.println("</head>"); out.println("<body>"); out.println("Questa pagina e' stata visualizzata"); out.println("<h1>"+conta+ "</h1> volte."); out.println("</body>"); out.println("</html>"); out.close(); } } and here is web.xml <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <servlet> <servlet-name>Contatore</servlet-name> <servlet-class>Contatore</servlet-class> </servlet> <servlet-mapping> <servlet-name>Contatore</servlet-name> <url-pattern>/Contatore</url-pattern> </servlet-mapping> </web-app> Can someone help me? Thanks Eugenia Mariani _________________________________________________________________ Scarica gratuitamente MSN Toolbar! http://toolbar.msn.it/ |