Jetty server configuration

前端 未结 2 1910
忘了有多久
忘了有多久 2021-01-15 02:30

I use Jetty 9 and have some problems with configuration. I simple RESTs works fine. But the problem begun when I tried to add new headers to all requests and error handler.

2条回答
  •  醉酒成梦
    2021-01-15 03:18

    Similar approach as peeskillet mentioned, but I have held jetty configuration in jetty.xml in my application.

    So to add custom filters I had to register them in the jetty.xml file as:

    
    
        
            
                
                    
                        
                          
                            com.sun.jersey.config.property.packages
                            ...my package
                          
                          
                            com.sun.jersey.spi.container.ContainerResponseFilters
                            ...MyCorsResponseFilter
                          
                        
                    
                
            
        
    
    

提交回复
热议问题