How to serve static resources from a Vaadin/Spring application?

后端 未结 3 730
庸人自扰
庸人自扰 2021-01-14 06:09

I have Vaadin web application with spring security integration for authentication. The configuration of the Vaadin servlet is pretty simple:

         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-14 07:09

    Use a url rewrite filter to get more contro on url mapping.

    
        UrlRewriteFilter
        org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
    
    
        UrlRewriteFilter
        /*
    
    

    then map Vaadin application to /vaadin for example and configure url maping in urlrewrite.xml

     
        /styles/**
        /styles/$1
     
     
        /images/**
         /images/$1
     
     
        /**
        /vaadin/$1
     
     
        /vaadin/**
         /$1
        
    

    EDIT Other option is put static files in /VAADIN/ directory.

提交回复
热议问题