zoukankan      html  css  js  c++  java
  • 【Servlet】The servlets named [ByteServlet] and [content.ByteServlet] are both mapped to the url-pattern [ByteServlet] which is not permitted

    创建时间:6.30

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

    报这个错误的原因是:Servlet注解和web.xml中url-pattern配置冲突

    前段时间学Servlet时,总会碰到这个问题

     

    看了控制台,发现是重复配置url-pattern的原因。但我自己并没有配置

     

     

     

    后来发现原因是,创建web项目时选择的web版本是2.5,而且勾上了自动生成web.xml,在写Servlet时又加上了注解,反复配置了两次url-pattern

     

     

     

    web.xml中:

     

     

     

    解决方法:删除其中一个即可。但如果版本选的是2.5,自动生成web.xml没有勾上,在项目管理器里创建Servlet还是会帮你自动配置,所以建议不写注解。

     

    项目管理器创建Servlet:

  • 相关阅读:
    day-8 xctf-guess_num
    CTF导引(一)
    day-7 xctf-level2
    day-6 xctf-hello_pwn
    day-5 xctf-when_did_you_born
    day-4 xctf-pwn CGfsb
    CrackMe_002
    如何将Map对象转换为一个实体类对象
    索引相关问题
    事务相关知识总结
  • 原文地址:https://www.cnblogs.com/musecho/p/11237180.html
Copyright © 2011-2022 走看看