vue tomcat子目录部署设置

vue router配置

const router = new VueRouter({
    mode: 'history',
+   base: '/static/',
    routes
})

页面刷新404

webapps\ROOT\WEB-INF\web.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                      http://java.sun.com/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0"
         metadata-complete="true">
    <display-name>webapp</display-name>
    <description>
        webapp
    </description>
    <error-page>
        <error-code>404</error-code>
        <location>/static/index.html</location>
    </error-page>
</web-app>