IDEA 第一次创建Servlet时出现 The origin server did not find a current representation for the...错误...

2023-05-16

 

错误截图:

错误截图

 

创建时的设置:

 

 

web.xml:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <servlet>
        <servlet-name>demo01</servlet-name>
        <servlet-class>com.learning.web.servlet.ServletDemo01</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>demo01</servlet-name>
        <url-pattern>/demo01</url-pattern>
    </servlet-mapping>
</web-app>  

 

 

解决一:

  将红框内 Application contet文本框设置为空。

  此时在浏览器中输入的是localhost:8080/demo01

 

 解决二:

  不改变Application context中的内容,在浏览器中应该输入的是localhost:8080/learning03_war_exploded/demo01

 

注意虚拟路径的问题。

转载于:https://www.cnblogs.com/letherwave/p/11390863.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

IDEA 第一次创建Servlet时出现 The origin server did not find a current representation for the...错误... 的相关文章

随机推荐