xnxqs 发表于 2019-3-10 15:12:59

静态资源文件的访问路径的配置

我在spring -mvc仿照swagger配置了静态资源 ,但仍无法访问相关的html. 请教一下该如何解决?

<mvc:annotation-driven />
        <mvc:resources mapping="/ty/**" location="/ty/" cache-period="31556926" />
        <mvc:resources mapping="/swagger/**" location="/swagger/" cache-period="31556926" />



经实验发现,我把<mvc:resources mapping="/swagger/**" location="/swagger/" cache-period="31556926" />注释掉,也能正常访问 http://localhost:8081/pg2019/swagger/index.html   感觉一脸懵逼,请问静态资源 的访问,到底在哪里?


页: [1]
查看完整版本: 静态资源文件的访问路径的配置