Hi everyone,I am a beginner of Servlet.
I want to replace web.xml with annotation @WebServlet to specify the url.Here's my servlet class annotation.
@WebServlet(urlPatterns="/demo1")
But I got a 404 NotFound error when I ran the project and entered "localhost/demo1"(port is set to 80) in Browser's url input field.I have checked the configuration in web.xml,in which the version is 4.0 and metadata-complete is false.
I have searched on net for a long time.But no use.Please help or try to give some ideas about how to achieve this.
Thanks in advance.