Home > Back-end >  Spring MVC - unable to load the static files
Spring MVC - unable to load the static files

Time:12-04

I novice, just learn spring MVC, using axios to download file to the local, can't introduce, js files created after tests found themselves and the way of CDN introduced is no problem, and found the download contextType introduced local response information is also sets the text/HTML & lt; MVC: default - servlet - handler/& gt; And & lt; MVC: resources mapping="/js/* *" location="/js/"/& gt; Both is invalid, please help for help

Spring - the MVC code configuration file
 






Js code can request the second to the first result is 404
 
<script SRC="https://bbs.csdn.net/topics/${pageContext. Request. ContextPath}/js/axios. Js" & gt; </script>
<script SRC="https://unpkg.com/axios/dist/axios.min.js" & gt; </script>
<script>
Axios. Post (' http://localhost/user3 ', [{
The username: 'Joe',
Age: 20,
Date: '1997-10-10'
}, {
The username: 'bill',
Age: 30,
Date: '1997-10-11'
}]). Then (res=& gt; {
The console. The log (res) data)
})
</script>
  • Related