HTTP Status 404 – Not Found Type Status Report
Message /gerenciador/oi
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.14
package br.com.alura.gerenciador.servlet;
import java.io.IOException;
import java.io.PrintWriter;
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(urlPatterns="/oi")
public class OiMundoServlet extends HttpServlet{
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws IOException {
PrintWriter out = resp.getWriter();
out.println("<html>");
out.println("<body>");
out.println("oi mundo, parabens vc escreveu o primeiro servlets.");
out.println("</body>");
out.println("</html>");
System.out.println("Olá mundo, console");
}
}
O "bem-vindo.html" funciona corretamente, mas ao usar nosso HttpServlet ocorre o 404
Já tentei reiniciar a máquina pra limpar o cache, mudar a versão do tomcat (8.5), recriar o projeto e nada funcionou