I get 404 error in my browser, after I start my tomcat :

I type in `localhost:8080/mvc/hello` or `localhost:8080/mvc/hello.jsp`

[![enter image description here](https://i.stack.imgur.com/lYSs6.jpg)](https://i.stack.imgur.com/lYSs6.jpg)

But if I type in `localhost:8080`, it is normal, can access:

[![enter image description here](https://i.stack.imgur.com/yBsNH.jpg)](https://i.stack.imgur.com/yBsNH.jpg)

In my `springmvc-servlet.xml`:

```
<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans"     
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:context="http://www.springframework.org/schema/context"   
 xmlns:mvc="http://www.springframework.org/schema/mvc" 
 xsi:schemaLocation="http://www.springframework.org/schema/beans 
 http://www.springframework.org/schema/beans/spring-beans.xsd 
 http://www.springframework.org/schema/context 
 http://www.springframework.org/schema/context/spring-context-4.1.xsd  
 http://www.springframework.org/schema/mvc 
 http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd"> 
    <!-- scan the package and the sub package --> 
    <context:component-scan base-package="com.ypd.springmvcdemo"/>
    <!-- don't handle the static resource -->
    <mvc:default-servlet-handler />
    <!-- if you use annotation you must configure following setting -->
    <mvc:annotation-driven />
    <!-- configure the InternalResourceViewResolver -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="internalResourceViewResolver">

        <property name="prefix" value="/WEB-INF/jsp/" />

        <property name="suffix" value=".jsp" />
    </bean>
</beans>

```

And in my `MVCController.java`:

```
@Controller
@RequestMapping("/mvc")
public class MVCController {
    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }
}

```

In my `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_3_1.xsd"
         version="3.1">

    <!--configure the setting of springmvcDispatcherServlet and configure the mapping-->
   <servlet>
       <servlet-name>springmvc</servlet-name>
       <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
       <init-param>
           <param-name>contextConfigLocation</param-name>
           <param-value>classpath:springmvc-servlet.xml</param-value>
       </init-param>
   </servlet>

    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>

```

This is my page of `hello.jsp`:

[![enter image description here](https://i.stack.imgur.com/cBAbP.jpg)](https://i.stack.imgur.com/cBAbP.jpg)

(I am sorry about the `springmvc-servlet.xml`'s position, I have locate it to under the `resource` library)

**UPDATE - 1:**

I am so sorry about it, there is a mistake when I post this snapshot, in my issue project, the web folder has no blue dot on it.See my answer I find the issue with it.

Update image:

![](https://i.stack.imgur.com/ZmmXD.jpg)

---

So, where is the mistake?

---

**EDIT**

My `hello.jsp`:

```
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
Hello, world, jack loly!
</body>
</html>

```

---

**EDIT**

Logs looks like correct:

> 
> [2017-03-20 03:06:48,255] Artifact SpringMVCDemo:war exploded: Server is not connected. Deploy is not available.
>  Connected to the target VM, address: '127.0.0.1:51764', transport: 'socket'
>  20-Mar-2017 15:06:50.080 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M17
>  20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Jan 10 2017 20:59:20 UTC
>  20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0
>  20-Mar-2017 15:06:50.085 info [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Mac OS X
>  20-Mar-2017 15:06:50.088 info [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 10.12.2
>  20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: x86\_64
>  20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /Library/Java/JavaVirtualMachines/jdk1.8.0\_121.jdk/Contents/Home/jre
>  20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0\_121-b13
>  20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
>  20-Mar-2017 15:06:50.089 info [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA\_BASE: /Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat\_9\_0\_0\_M17\_SpringMVCDemo
>  20-Mar-2017 15:06:50.090 info [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA\_HOME: /Users/jack/Library/Tomcat9
>  20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat\_9\_0\_0\_M17\_SpringMVCDemo/conf/logging.properties
>  20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>  20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -agentlib:jdwp=transport=dt\_socket,address=127.0.0.1:51764,suspend=y,server=n
>  20-Mar-2017 15:06:50.091 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
>  20-Mar-2017 15:06:50.092 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
>  20-Mar-2017 15:06:50.093 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/Users/jack/Library/Caches/IntelliJIdea2016.3/tomcat/Tomcat\_9\_0\_0\_M17\_SpringMVCDemo
>  20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/Users/jack/Library/Tomcat9
>  20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/Users/jack/Library/Tomcat9/temp
>  20-Mar-2017 15:06:50.094 info [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/jack/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
>  20-Mar-2017 15:06:50.527 info [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
>  20-Mar-2017 15:06:50.560 info [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
>  20-Mar-2017 15:06:50.563 info [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
>  20-Mar-2017 15:06:50.565 info [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
>  20-Mar-2017 15:06:50.581 info [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1455 ms
>  20-Mar-2017 15:06:50.709 info [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
>  20-Mar-2017 15:06:50.709 info [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M17
>  20-Mar-2017 15:06:50.745 info [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
>  20-Mar-2017 15:06:50.766 info [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [ajp-nio-8009]
>  20-Mar-2017 15:06:50.769 info [main] org.apache.catalina.startup.Catalina.start Server startup in 187 ms
>  Connected to server
>  [2017-03-20 03:06:51,046] Artifact SpringMVCDemo:war exploded: Artifact is being deployed, please wait...
>  [2017-03-20 03:06:51,751] Artifact SpringMVCDemo:war exploded: Artifact is deployed successfully
>  [2017-03-20 03:06:51,751] Artifact SpringMVCDemo:war exploded: Deploy took 705 milliseconds
>  20-Mar-2017 15:07:00.750 info [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /Users/jack/Library/Tomcat9/webapps/manager
>  20-Mar-2017 15:07:00.802 info [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /Users/jack/Library/Tomcat9/webapps/manager has finished in 52 ms
> 
> 
> 

---

**EDIT**

My tomcat deployment config:
[![enter image description here](https://i.stack.imgur.com/Srz8V.jpg)](https://i.stack.imgur.com/Srz8V.jpg)

---

**EDIT -2**

[![enter image description here](https://i.stack.imgur.com/7wdqY.jpg)](https://i.stack.imgur.com/7wdqY.jpg)