Visualizzazione dei risultati da 1 a 8 su 8
  1. #1

    compilare una servlet

    ciao a tutti, so poco di java.
    dunque, dovrei compilare una servlet (CiaoMondo.java) che sta su E:\Programmi\Apache Tomcat 4.0\webapps\prove. il jDK è su C:\jdk1.4.
    ho provato lanciare il comando JAVAC in tutte le salse, COME FACCIO A COMPILARLA? il path l'ho settato. aiutatemi a superare sto muro e non vi stresso + con sta compilazione, grazie!
    max
    "0 è tutto finito. 1 è solo l'inizio"
    HO IL CERTIFICATO DI RESISTENZA.

  2. #2
    il fatto è che mi da un sacco di errori "cannot resolve symbol" e penso vivamente che non trova le librerie necessarie per la compilazione (quelle contenute in tomcat). dove stanno ste librerie necessarie e dove le posso piazzare affinchè il compilatore le veda?
    grazie
    "0 è tutto finito. 1 è solo l'inizio"
    HO IL CERTIFICATO DI RESISTENZA.

  3. #3
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Sotto la directory dove sta tomcat non c'è una directory "lib" ? Dovrebbero stare là...
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  4. #4
    intanto grazie per la risposta.
    certo, sotto la directory c'è la Apache Tomcat 4.0/common/lib e la Apache Tomcat 4.0/lib, qual'è quella buona? che ne faccio delle librerie? le copio nella jdk/lib?
    "0 è tutto finito. 1 è solo l'inizio"
    HO IL CERTIFICATO DI RESISTENZA.

  5. #5
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Io li aggiungerei al classpath. Dovrebbero essere quelli sotto lib (senza common)...

    [Edit]
    No, ho detto una vaccata...
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  6. #6

    comunque gli errori sono questi:

    essendo poco esperto perdonami se trovi delle nefandezze:


    CiaoMondoServlet.java [2:1] Import expects a class name
    import.javax.servlet.*;
    ^
    CiaoMondoServlet.java [3:1] Import expects a class name
    import.javax.servlet.http;
    ^
    CiaoMondoServlet.java [5:1] Class HttpServlet not found in type declaration or import.
    public class CiaoMondoServlet extends HttpServlet
    ^
    CiaoMondoServlet.java [8:1] Class ServletException not found in type declaration or import.
    throws IOException, ServletException, ServletException{
    ^
    CiaoMondoServlet.java [8:1] Class ServletException not found in type declaration or import.
    throws IOException, ServletException, ServletException{
    ^
    CiaoMondoServlet.java [7:1] Class HttpServletRequest not found in type declaration or import.
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    CiaoMondoServlet.java [7:1] Class HttpServletResponse not found in type declaration or import.
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    CiaoMondoServlet.java [7:1] Class ServletException must be a subclass of class java.lang.Throwable.
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    CiaoMondoServlet.java [7:1] Class ServletException must be a subclass of class java.lang.Throwable.
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    ^
    9 errors

    [edit]
    il file.java è questo

    import java.io.*;
    import.javax.servlet.*;
    import.javax.servlet.http;

    public class CiaoMondoServlet extends HttpServlet
    {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException, ServletException{
    PrintWriter out = response.getWriter();
    out.println("Ciao Mondo!");


    }

    }
    "0 è tutto finito. 1 è solo l'inizio"
    HO IL CERTIFICATO DI RESISTENZA.

  7. #7
    Utente di HTML.it L'avatar di Corwin
    Registrato dal
    Jan 2002
    Messaggi
    584
    Comincia a togliere i punti dopo import ..


    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http;
    I don't wanna have to shout it out / I don't want my hair to fall out
    I don't wanna be filled with doubt / I don't wanna be a good boy scout
    I don't wanna have to learn to count / I don't wanna have the biggest amount
    I don't wanna grow up

  8. #8
    grazie, tutto ok!
    uso forte for java per compilare, lo trovo un ottimo editor.
    "0 è tutto finito. 1 è solo l'inizio"
    HO IL CERTIFICATO DI RESISTENZA.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.