Reloading the page gives wrong GET request with AngularJS HTML5 mode

前端 未结 24 2909
慢半拍i
慢半拍i 2020-11-22 01:39

I want to enable HTML5 mode for my app. I have put the following code for the configuration, as shown here:

return app.config([\'$routeProvider\',\'$location         


        
24条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 02:01

    Your server side code is JAVA then Follow this below steps

    step 1 : Download urlrewritefilter JAR Click Here and save to build path WEB-INF/lib

    step 2 : Enable HTML5 Mode $locationProvider.html5Mode(true);

    step 3 : set base URL

    step 4 : copy and paste to your WEB.XML

     
         UrlRewriteFilter
     org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
    
    
    
        UrlRewriteFilter
        /*
        REQUEST
        FORWARD
    
    

    step 5 : create file in WEN-INF/urlrewrite.xml

     
    
    
        
                /
                /index.html
            
    
        
        
                /example
                /index.html
            
        
    

提交回复
热议问题