Home  >  Article  >  Web Front-end  >  What to do if vue.js refreshes 404 page not found

What to do if vue.js refreshes 404 page not found

coldplay.xixi
coldplay.xixiOriginal
2020-11-10 15:59:463435browse

vue.js solution to refresh 404 page not found: first unzip the package to the ROOT directory and create the [WEB-INF] directory; then enter the [WEB-INF] directory and create [web.xml ] file; finally edit [web.xml].

What to do if vue.js refreshes 404 page not found

The operating environment of this tutorial: windows10, vue2.5.2, this article is applicable to all brands of computers.

【Related article recommendations: vue.js

vue.js Solution to refresh 404 page not found:

1. Unzip the package to the ROOT directory and create the WEB-INF directory

mkdir WEB-INF

2. Enter the WEB-INF directory and create the web.xml file

cd WEB-INF
touch web.xml

3. Edit 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"
  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>

Related free learning recommendations: JavaScript (video)

The above is the detailed content of What to do if vue.js refreshes 404 page not found. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn