react routing is able to handle different url path but tomcat returns 404 not available resources

后端 未结 8 1580
时光取名叫无心
时光取名叫无心 2020-12-07 15:01

I am new in reactjs and I have a little project in reactjs to play with and learn it. I need to have to type of headers which will be shown based o

8条回答
  •  被撕碎了的回忆
    2020-12-07 15:36

    For Tomcat versions below 8. You can just add a web.xml file and route the 404 to index.html.

    webapps/[my-app-name]/WEB-INF/web.xml

    
    
    
      my-app-name
    
      
        404
        /index.html
      
    
    
    

提交回复
热议问题