MVC在生成项目的时候会生成的WEB-INF底下.这个文件夹下面的文件是受保护的,都会走MVC的流程,

但是我希望在WebContent底下可以使用静态页面,

那么需要进入springmvc-servlet.xml 页面,加上一句话:  <mvc:resources mapping="/**"  location="/**" />

这样,使用mvc:resources标签,可以将根目录下的文件全部定义为静态html,直接访问即可.

需要放到文件夹中:

<mvc:resources mapping="/commons/**"  location="/commons/**" />

相关文章:

  • 2022-12-23
  • 2021-07-29
  • 2021-10-30
  • 2022-12-23
  • 2021-10-27
  • 2021-11-08
  • 2022-12-23
  • 2021-05-18
猜你喜欢
  • 2021-07-26
  • 2022-12-23
  • 2022-02-13
  • 2021-05-08
  • 2021-10-17
相关资源
相似解决方案