I have the following situation: I am working on a project where I initially used 3 servlets and everything worked great, the problem was when I tried to create a fourth servert. For some reason that I have not been able to understand, no JSP wanted to connect with that last servlet (the classic HTTP Status 404 - Not found: The required resource [...] is not available appears), it connects with any of the other three, and with their respective GET and POST, thus demonstrating that the problem is not in Apache Tomcat, but it simply does not do so with this room. It should be noted that I have verified it and indeed I have no writing errors. I don't know if there is some limitation on the number of servlet options that are allowed to be used, so my project is limited to a maximum of three servlets, or if it is some other kind of problem. As a development environment I am using NetBeans.
I've tried deleting the fourth servlet and recreating it, and I've also tried invoking it in a different JSP, however the same thing happens.
Below is the JSP it is called from.
<h1>Iniciar sesion</h1><br><% String mensaje = request.getParameter("mensajeError"); if(mensaje == null){ mensaje=""; }%><form action="SvLoggin" method="POST"><div class="form"><label>Usuario</label><br><input type="text" id="user" name="usuario"><br><label>Contraseña</label><br><input type="password" id="pass" name="contraseña"><br><div id="verificacion"><p><%=mensaje%></p></div><button onclick="" class="button"> Inicio </button><br></div></form>
and this is the servlet
public class SvLoggin extends HttpServlet {protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); try (PrintWriter out = response.getWriter()) { /* TODO output your page here. You may use following sample code. */ out.println("<!DOCTYPE html>"); out.println("<html>"); out.println("<head>"); out.println("<title>Servlet SvLoggin</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Servlet SvLoggin at " + request.getContextPath() +"</h1>"); out.println("</body>"); out.println("</html>"); }}@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response);}@Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response);}@Overridepublic String getServletInfo() { return "Short description";}
but the result is
**this is the web.xml**
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" version="6.0"><session-config><session-timeout> 30</session-timeout></session-config></web-app>
thanks