How to access static resources when mapping a global front controller servlet on /*

前端 未结 19 2134
轮回少年
轮回少年 2020-11-22 07:35

I\'ve mapped the Spring MVC dispatcher as a global front controller servlet on /*.

               


        
19条回答
  •  粉色の甜心
    2020-11-22 08:17

    If you use Tomcat, you can map resources to the default servlet:

    
        default
        /static/*
    
    

    and access your resources with url http://{context path}/static/res/...

    Also works with Jetty, not sure about other servlet containers.

提交回复
热议问题