Getting HTTP Status 404 error when trying to run servlet [duplicate]

时间秒杀一切 提交于 2019-11-29 11:52:07

The compiled Hello.class file should be in the folder

webapps/ServletTest/WEB-INF/classes/Main

since it's declared to be in package Main.

Also, you can see Tomcat's startup logs in /logs/catalina.out or /logs/catalina.log, depending.


Also, Suresh is right in the comments, use either a <servlet> declaration or @WebServlet. Don't use both.

Try to delete web.xml. Annotation @WebServlet("/Hello") is enough for Tomcat 7+

If the root folder not having proper permission you will face this issue. So please check the root folder property and remove read only permission and add user to full access permission in security tab.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!