How to handle static content in Spring MVC?

前端 未结 23 2500
春和景丽
春和景丽 2020-11-22 03:28

I am developing a webapp using Spring MVC 3 and have the DispatcherServlet catching all requests to \'/\' like so (web.xml):

  
          


        
23条回答
  •  攒了一身酷
    2020-11-22 03:45

    From Spring 3, all the resources needs to mapped in a different way. You need to use the tag to specify the location of the resources.

    Example :

    
    

    By doing this way, you are directing the dispatcher servlet to look into the directory resources to look for the static content.

提交回复
热议问题