zoukankan      html  css  js  c++  java
  • java web程序中web.xml文件中servlet-name、url-pattern的值不能与映射的类名一致,否则tomcat启动不了,报错误: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet_day02]]

         新建一个web程序Servlet_day02新建一个ServletDemo1类继承HttpServlet,然后配置web.xml:

    启动tomcat,一直报错:

      

    报的错误是:Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/Servlet_day02]],

    Caused by: java.lang.IllegalArgumentException: The servlets named [ServletDemo1] and [com.guan.servlet.ServletDemo1] are both mapped to the url-pattern [/ServletDemo1] which is not permitted

    说明:servlet-name与url-pattern不能都与映射的类文件名相同。修改之:

    启动tomcat,成功。

  • 相关阅读:
    React 构建方法总结
    集思广益 (一)
    C#方法调用
    C# Hello World 实例
    C# 环境
    C# 简介
    对象类型的本地写入---plist文件创建以及读取
    正则判断 手机邮箱的正确格式
    数组去重
    Base64编码
  • 原文地址:https://www.cnblogs.com/gwq369/p/5217232.html
Copyright © 2011-2022 走看看