コード例 #1
0
 private void addAutoDiscoveredServlets(WebappContext webappContext) {
   serverData
       .getRootContext()
       .getBeansOfType(ServletConfiguration.class)
       .values()
       .forEach(
           servlet -> {
             setInitParameters(
                     webappContext.addServlet(getName(servlet), getServlet(servlet)), servlet)
                 .addMapping(servlet.getMapping());
             logServlet(servlet);
           });
 }
コード例 #2
0
 private void addAutoDiscoveredFilters(ServletContext webappContext) {
   serverData
       .getRootContext()
       .getBeansOfType(FilterConfiguration.class)
       .values()
       .stream()
       .peek(this::logFilter)
       .forEach(
           filter ->
               setInitParameters(
                       webappContext.addFilter(getName(filter), getClass(filter)), filter)
                   .addMappingForUrlPatterns(
                       EnumSet.allOf(DispatcherType.class), true, filter.getMapping()));
 }