Package javax.servlet

Examples of javax.servlet.FilterRegistration.addMappingForUrlPatterns()


              // Adding resources with new extensions still requires a restart.

          // Development mode only works when the dispatch mode is not DO_FILTER, since DO_FILTER mode depends
          // on the Faces Servlet being "exact"-mapped on the view resources.

          facesViewsRegistration.addMappingForUrlPatterns(null, isFilterAfterDeclaredFilters(servletContext), "/*");
        } else {

          // In non-development mode, only map this Filter to specific resources

          // Map the forwarding filter to all the resources we found.
View Full Code Here


          // In non-development mode, only map this Filter to specific resources

          // Map the forwarding filter to all the resources we found.
          for (String resource : collectedViews.keySet()) {
            facesViewsRegistration.addMappingForUrlPatterns(null, isFilterAfterDeclaredFilters(servletContext), resource);
          }

          // Additionally map the filter to all paths that were scanned and which are also directly
          // accessible. This is to give the filter an opportunity to block these.
          for (String path : getPublicRootPaths(servletContext)) {
View Full Code Here

          }

          // Additionally map the filter to all paths that were scanned and which are also directly
          // accessible. This is to give the filter an opportunity to block these.
          for (String path : getPublicRootPaths(servletContext)) {
            facesViewsRegistration.addMappingForUrlPatterns(null, false, path + "*");
          }
        }

        // We now need to map the Faces Servlet to the extensions we found, but at this point in time
        // this Faces Servlet might not be created yet, so we do this part in FacesViewInitializedListener.
View Full Code Here

        else
        {
            registration=sce.getServletContext().getFilterRegistration("TestFilter");
        }
        registration.setInitParameter("remote", "false");
        registration.addMappingForUrlPatterns(
                EnumSet.of(DispatcherType.ERROR,DispatcherType.ASYNC,DispatcherType.FORWARD,DispatcherType.INCLUDE,DispatcherType.REQUEST),
                true,
                new String[]{"/*"});
    }

View Full Code Here

        dynamic.addMapping("/");

        //4、CharacterEncodingFilter
        FilterRegistration filterRegistration =
                sc.addFilter("characterEncodingFilter", CharacterEncodingFilter.class);
        filterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/*");


    }
}
View Full Code Here

                    final FilterRegistration filterRegistration =
                            context.addFilter(filterDescriptor.getFilterName(), filterDescriptor.getFilterClass());

                    filterRegistration.setInitParameters(filterDescriptor.getInitParams());
                    filterRegistration.addMappingForUrlPatterns(
                            grizzlyDispatcherTypes(filterDescriptor.getDispatcherTypes()),
                            true,
                            servletPathLocal);
                }
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.