Spring MVC Static Resource Mapping

后端 未结 1 329
遇见更好的自我
遇见更好的自我 2021-01-19 17:54

I have the following servlet mapping present -

  
     

        
相关标签:
1条回答
  • 2021-01-19 18:52

    You need to modify links to the images. When you write

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

    Then your HTTP requests to /resources/images are translated to webapp/images folder on the server. So in the html you should have something like this:

    <img src="<spring:url value='/resources/images/logo.png'/>"
    
    0 讨论(0)
提交回复
热议问题