spring mvc 项目部署到tomcat浏览器浏览显示$end$

图片说明
图片说明
图片说明
但是下面这种方式测试时是正确的
图片说明
请各位帮我分析下是什么原因

我也遇到这个问题了,发现是idea自己启的网页里的地址没有启全,手动补上就出来了

启的是这个
http://localhost:8081/
实际是这个
http://localhost:8081/hello

你应该是没有部署到正确web目录下,idea识别不出来,这个$END$ 是默认的index页面

web.xml和home.html贴出来

https://blog.csdn.net/xinyingshi/article/details/82025880
看看你的war包的maven依赖都添加进去没

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">
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

home.html

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body>
<h1>Welcome to Spittr</h1>
<a href="/spittles">Spittles</a> |
<a href="/spittles/register">Register</a>
</body>
</html>

请问您知道原因了吗