bonjour,
Je viens d'installer la JSDK (Sun Java System Application Server Platform Edition 8.2 (build b06-fcs)) avec le serveur d'évaluation... et le JDK 1.5 il me semble.
J'ai vérifié la path de windows elle est correct :
et quand je compile ma servlet très simple ...C:\Documents and Settings\Max\Mis documentos\Max work\Ejercicio5 - Servlet\servlet>PATH
PATH=C:\Archivos de programa\Java\jdk1.5.0_08\bin;C:\Documents and Settings\Max\
Mis documentos\Max work\Ejercicio5 - Servlet\servlet;C:\WINDOWS\system32;C:\WIND
OWS;C:\WINDOWS\System32\Wbem;C:\ARCHIV~1\ULTRAE~1;C:\Sun\AppServer\bin
Voila ce que j'obtiens comme erreur ... comme si il ne connaissait pas la classe Servlet alors que la path est bonne ...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class SomeServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Use "request" to read incoming HTTP headers (e.g. cookies) // and HTML form data (e.g. data the user entered and submitted) // Use "response" to specify the HTTP response line and headers // (e.g. specifying the content type, setting cookies). PrintWriter out = response.getWriter(); // Use "out" to send content to browser } }![]()
Microsoft Windows XP [Versión 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Max>cd C:\Documents and Settings\Max\Mis documentos\Ma
x work\Ejercicio5 - Servlet\servlet
C:\Documents and Settings\Max\Mis documentos\Max work\Ejercicio5 - Servlet\servl
et>javac MyServlet.java
MyServlet.java:6: class SomeServlet is public, should be declared in a file name
d SomeServlet.java
public class SomeServlet extends HttpServlet
^
MyServlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
MyServlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
MyServlet.java:6: cannot find symbol
symbol: class HttpServlet
public class SomeServlet extends HttpServlet
^
MyServlet.java:8: cannot find symbol
symbol : class HttpServletRequest
location: class SomeServlet
public void doGet(HttpServletRequest request, HttpServletRespons
e response)
^
MyServlet.java:8: cannot find symbol
symbol : class HttpServletResponse
location: class SomeServlet
public void doGet(HttpServletRequest request, HttpServletRespons
e response)
^
MyServlet.java:9: cannot find symbol
symbol : class ServletException
location: class SomeServlet
throws ServletException, IOException
^
7 errors
Merci de m'éclairer ...
Partager