O que ah de errado no meu código?
[code]import java.io.;
import javax.servlet.;
import javax.servlet.http.*;
public class Hello extends HttpServlet
{
public void doGet (HttpServletRequest requisicao,
HttpServletResponse resposta)
throws ServletException, IOException
{
PrintWriter out;
resposta.setContentType(“text/html”);
out = resposta.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>JSP - Hello, World!</title>");
out.println("</head>");
out.println("<body>");
out.println("<h2>Primeira página com servlets</h2>");
out.println("<p>Hello word!</p>");
out.println("</body>");
out.println("</html>");
}
}[/code]
Quando compilo ele pelo cmd javac da esse erro:
Hello.java:2: error: package javax.servlet does not exist
import javax.servlet.;
^
Hello.java:3: error: package javax.servlet.http does not exist
import javax.servlet.http.;
^
Hello.java:5: error: cannot find symbol
public class Hello extends HttpServlet
^
symbol: class HttpServlet
Hello.java:7: error: cannot find symbol
public void doGet (HttpServletRequest requisicao,
^
symbol: class HttpServletRequest
location: class Hello
Hello.java:8: error: cannot find symbol
HttpServletResponse resposta)
^
symbol: class HttpServletResponse
location: class Hello
Hello.java:9: error: cannot find symbol
throws ServletException, IOException
^
symbol: class ServletException
location: class Hello
error: Class names, ‘classpath’, are only accepted if annotation processing is e
xplicitly requested
7 errors