【轉】】Vue項目部署tomcat,刷新報錯404解決辦法


轉自【https://blog.csdn.net/g631521612/article/details/82835518】

解決方式:

- 在tocmat的webapps下的項目中創建WEB-INF文件夾,在文件夾中創建文件web.xml。格式如下:

 

 

- 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" metadata-complete="true">
<display-name>Router for Tomcat</display-name>
  <error-page>
  <error-code>404</error-code>
  <location>/index.html</location>
  </error-page>
</web-app>

重啟,刷新,完美修復。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM