File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
gxspringboot/src/main/java/com/genexus/springboot Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 1313import org .glassfish .jersey .servlet .ServletProperties ;
1414import org .springframework .boot .web .servlet .FilterRegistrationBean ;
1515import org .springframework .beans .factory .annotation .Value ;
16+ import org .springframework .boot .web .servlet .ServletContextInitializer ;
1617import org .springframework .context .annotation .Bean ;
1718import org .springframework .context .annotation .Configuration ;
1819import org .springframework .core .Ordered ;
@@ -92,14 +93,17 @@ public FilterRegistrationBean<UrlRewriteFilter> urlRewriteFilter() {
9293 }
9394
9495 @ Bean
95- public FilterRegistrationBean <ServletContainer > jerseyFilter () {
96- ResourceConfig rc = new ResourceConfig ();
96+ public ServletContextInitializer jerseyFilter () {
9797 Set <Class <?>> rrcs = JaxrsResourcesHolder .getAll ();
98- if (! rrcs . isEmpty ()) {
99- rc . registerClasses (rrcs .toArray ( new Class <?>[ 0 ]));
100- rc . property ( ServletProperties . FILTER_FORWARD_ON_404 , true ) ;
98+
99+ if (rrcs .isEmpty ()) {
100+ return sc -> {} ;
101101 }
102102
103+ ResourceConfig rc = new ResourceConfig ();
104+ rc .registerClasses (rrcs .toArray (new Class <?>[0 ]));
105+ rc .property (ServletProperties .FILTER_FORWARD_ON_404 , true );
106+
103107 ServletContainer container = new ServletContainer (rc );
104108
105109 FilterRegistrationBean <ServletContainer > reg = new FilterRegistrationBean <>(container );
You can’t perform that action at this time.
0 commit comments