Bonjour je veux juste faire un ti helloworld grrr!
g repris mot a mot:
http://lfe.developpez.com/Java/Tom [...] e_4#L3.2.2
mon url:
http://localhost:8080/TestTomCat/Test
et marche poa erreur http 404
Merci
ma servlet:
package com.developpez.tomcat;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
PrintWriter writer = res.getWriter();
writer.println("Hello World !!!" );
}
}
mon web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<display-name>TestTomcat</display-name>
<servlet>
<servlet-name>Test</servlet-name>
<servlet-class>com.developpez.tomcat.Test</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Test</servlet-name>
<url-pattern>/Test</url-pattern>
</servlet-mapping>
</web-app>
Message édité par schum-hacker le 29-11-2007 à 16:59:40