Visualizzazione dei risultati da 1 a 10 su 13

Visualizzazione discussione

  1. #1

    Creare una Servlet su Eclipse

    Ho provato a creare una Servlet su Eclipse. Ho creato un server Tomcat 9 poi un Dynamic Web Project ed il risultato è stato questo:
    -Djava.endorsed.dirs=C:\Program Files\Java\apache-tomcat-9.0.8\endorsed is not supported. Endorsed standards and standalone APIs
    in modular form will be supported via the concept of upgradeable modules.
    Questo è il codice
    codice:
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Date;
    import javax.servlet.ServletException;
    import javax.servlet.annotation.WebServlet;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    @WebServlet("/index.jsp")
    public class MyServlet extends HttpServlet {
        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
            PrintWriter pw=resp.getWriter();
            pw.println("<html><head></head><body>");
            pw.println("<div>");
            pw.println(new Date().toString());
            pw.println("</div>");
            pw.println("</body></html>");
        }
    }
    Ho provato a cambiare la JVM in Eclipse mettendo la 8 come si suggerisce qui ma non ho risolto, ottengo questo errore:
    HTTP Status 404 – Not Found
    Type Status Report
    Message /02-MyServlet/index.jsp
    Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
    Apache Tomcat/9.0.8
    Ultima modifica di giannino1995; 19-06-2018 a 23:55
    Più pratica in futuro...

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.