【Servlet】The servlets named [ByteServlet] and [content.ByteServlet] are both mapped to the url-pattern [ByteServlet] which is not permitted

Created: 6.30

 

The servlets named [ByteServlet] and [content.ByteServlet] are both mapped to the url-pattern [/ByteServlet] which is not permitted

 

The cause of the error is reported: Servlet notes and web.xml in url-pattern configuration conflicts

 

 

Some time ago to learn Servlet, there will always encounter this problem

 

 

 

Looked at the console, I found to be the cause of repeated configure url-pattern. But I did not configure

 

 

 

 

 

 

The reason is later found to create a web selected when the project web version is 2.5 , but also on the hook to automatically generate the web.xml , in writing Servlet time and add annotations, repeatedly arranged two-pattern url .

 

 

 

 

web.xml:

 

 

 

 

Solution: Delete one can. But if the election is version 2.5 , automatically generates web.xml no hook, created in the Project Manager Servlet or will help you automatically configured, it is recommended not to write comments.

 

Project Manager to create a Servlet:

 

Guess you like

Origin www.cnblogs.com/musecho/p/11237180.html