
springboot spring.resources.static-locations引用外部静态资源 50
目的springboot引用外部静态资源,修改静态资源不用重启服务springbootspring.resources.static-locations=file:绝对路...
目的springboot引用外部静态资源,修改静态资源不用重启服务springboot spring.resources.static-locations=file:绝对路径spring.freemarker.template-loader-path=file:/home/projects/stare/resources/templates问题:本地引用的是项目内的没问题,放服务器上,如图html页面引用不到static/下的css和js,项目页面已经可以访问
展开
1个回答
展开全部
直接引用静态资源不行的,你要把静态资源也做成web服务。
换言之,你自己在浏览器里面能正常访问静态资源,且不能出现404
比如百度首页上引入css,
人家这个css能通过浏览器正常访问的,所以你这个跟springboot没啥关系,是web配置的问题
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |