Tomcat is unable to find my Servlet and is throwing exceptions, but why?

前端 未结 5 860
野的像风
野的像风 2021-01-11 18:48

I\'m trying to get into Java web development but seem to be running into a strange issue with Tomcat and an extremely simple servlet. The catalina log is spewing this every

5条回答
  •  醉酒成梦
    2021-01-11 19:05

    Are the lines below exactly from your web.xml? Tomcat finds the servlet mapping that maps /myservlet to the servlet named "MyServlet" but complains that it cannot find any servlet definition with that name. Case matters. What you provided looks correct, but double check your web.xml to make sure the case is correct. Double check the web.xml where Tomcat is using it, in the directory mywebapp/WEB-INF/web.xml

    
        MyServlet   <-- Check this name
        MyServlet
    
    
    
        MyServlet  <-- Compare against this name
        /myservlet
    
    

    If that's not it, let us know. But these names are case sensitive.

提交回复
热议问题