Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP

前端 未结 9 1358
小蘑菇
小蘑菇 2020-11-21 05:43

I\'m having trouble with loading CSS and images and creating links to other pages when I have a servlet forward to a JSP. Specifically, when I set my

9条回答
  •  暖寄归人
    2020-11-21 05:54

    If you are using Spring MVC, then you need to declare default action servlet for static contents. Add the following entries in spring-action-servlet.xml. It worked for me.

    NOTE: keep all the static contents outside WEB-INF.

    
    
        
    
    
    
        
    
    
    
    

提交回复
热议问题