How to handle static content in Spring MVC?

前端 未结 23 2462
春和景丽
春和景丽 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:48

    I just add three rules before spring default rule (/**) to tuckey's urlrewritefilter (urlrewrite.xml) to solve the problem

    
    
        
         
          /
          /app/welcome
         
         
          /scripts/**
          /scripts/$1
         
         
          /styles/**
          /styles/$1
         
         
          /images/**
          /images/$1
         
         
          /**
          /app/$1
         
         
          /app/**
          /$1
          
        
    

提交回复
热议问题