I have a web application in JSP. I made a computer change and migrated my eclipse project to the new computer. In the old one I had Tomcat 9, now I have Tomcat 10. I did not make any changes to the code when I sent everything to the new computer.
When I run my application and search for the first servlet, it cannot find it, it sends me an error:
HTTP Status 404 - Not Found
Status report type
message The required resource [/WebProject/LoginServlet] is not available
Description The required resource is not available.
Apache Tomcat/10.0.2
It is worth mentioning that I do not use the implementation descriptor, I use the annotations with the @WebServlet
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class LoginServlet
*/
@SuppressWarnings("serial")
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
...my content...
}
I rewrote a part of the application in another test project because I thought that maybe something would change between version 9 and 10 of Tomcat, however the result is the same. Although it seems that I have to define where it will take the servlets by default when using an annotation, I'm not sure where I can configure that.
Anyone who can help or guide me with this problem?