Servlet Http 404

When ever you run any dynamic web project. By default Servlet container (which is Tomcat in this case) searches for files specified in wel-come list. Check your web.xml, it should contains entry like

<welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list>

You haven't created file from any of the above list. So, running

http://localhost:8080/TEST2 will give you 404 error.

Rather run : http://localhost:8080/TEST2/HelloSerlvet will invoke the servlet which you have created.

Edit: Check Project Menu of eclipse and verify "Build Automatically" is checked and Servlet container is running (http://localhost:8080).

Edit 2: Right Click Project --> Properties, Select Java Build Path --> source Tab --> Change Default output folder. Create /WEB-INF/classes under /WebContent (default in eclipse)

你可能感兴趣的:(Servlet Http 404)