Serve files from folder outside web application in Jetty

后端 未结 2 1017
后悔当初
后悔当初 2021-02-02 03:47

I have a Java web application (Eclipse/OSGI) on a Jetty server. I want to be able to serve static files to my web application from a folder outside of the web root. In my web ap

2条回答
  •  生来不讨喜
    2021-02-02 04:25

    Solved it!

    This is what I added to my jetty.xml file:

    
        
            
                
                    
                        
                            /myContextPath
                            
                                
                                    false
                                    /actual/folder/on/file/system
                                
                            
                        
                    
                    [...other handlers...]
                
            
        
    
    

提交回复
热议问题