Package org.jboss.metadata.web.spec

Examples of org.jboss.metadata.web.spec.FilterMappingMetaData


      JIL.setListenerClass("org.jboss.weld.integration.webtier.jsp.JspInitializationListener");
      CPF = new FilterMetaData();
      CPF.setFilterName("Weld Conversation Propagation Filter");
      CPF.setFilterClass("org.jboss.weld.servlet.ConversationPropagationFilter");
      CPF.setAsyncSupported(true);
      CPFM = new FilterMappingMetaData();
      CPFM.setFilterName("Weld Conversation Propagation Filter");
      CPFM.setUrlPatterns(Arrays.asList("/*"));
      addOutput("merged." + JBossWebMetaData.class.getName());
   }
View Full Code Here


      FilterMetaData filter = new FilterMetaData();
      filter.setFilterClass(Filter30Dispatcher.class.getName());
      filter.setName("Resteasy");
      filter.setAsyncSupported(true);

      FilterMappingMetaData mapping = new FilterMappingMetaData();
      mapping.setFilterName("Resteasy");
      List<String> patterns = new ArrayList<String>();
      if (useScannedApplicationClass && resteasy.getScannedApplicationClass().isAnnotationPresent(ApplicationPath.class))
      {
         ApplicationPath path = resteasy.getScannedApplicationClass().getAnnotation(ApplicationPath.class);
         String pathValue = path.value().trim();
         if (!pathValue.startsWith("/"))
         {
            pathValue = "/" + pathValue;
         }
         String prefix = pathValue;
         if (pathValue.endsWith("/"))
         {
            pathValue += "*";
         }
         else
         {
            pathValue += "/*";
         }
         patterns.add(pathValue);
         setContextParameter(webdata, "resteasy.servlet.mapping.prefix", prefix);
      }
      else
      {
         patterns.add("/*");
      }
      mapping.setUrlPatterns(patterns);

      if (webdata.getFilters() == null)
      {
         webdata.setFilters(new FiltersMetaData());
      }
View Full Code Here

        JIL.setListenerClass(JSP_LISTENER);
        CPF = new FilterMetaData();
        CPF.setFilterName("Weld Conversation Propagation Filter");
        CPF.setFilterClass(CONVERSATION_FILTER);
        CPF.setAsyncSupported(true);
        CPFM = new FilterMappingMetaData();
        CPFM.setFilterName("Weld Conversation Propagation Filter");
        CPFM.setUrlPatterns(Arrays.asList("/*"));
    }
View Full Code Here

                            (largeIconValue == null) ? "" : largeIconValue.asString());
                if (descriptionGroup != null) {
                    filter.setDescriptionGroup(descriptionGroup);
                }
                filters.add(filter);
                FilterMappingMetaData filterMapping = new FilterMappingMetaData();
                filterMapping.setFilterName(filter.getName());
                List<String> urlPatterns = new ArrayList<String>();
                List<String> servletNames = new ArrayList<String>();
                List<DispatcherType> dispatchers = new ArrayList<DispatcherType>();
                AnnotationValue urlPatternsValue = annotation.value("urlPatterns");
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                urlPatternsValue = annotation.value();
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                if (urlPatterns.size() > 0) {
                    filterMapping.setUrlPatterns(urlPatterns);
                }
                AnnotationValue servletNamesValue = annotation.value("servletNames");
                if (servletNamesValue != null) {
                    for (String servletName : servletNamesValue.asStringArray()) {
                        servletNames.add(servletName);
                    }
                }
                if (servletNames.size() > 0) {
                    filterMapping.setServletNames(servletNames);
                }
                AnnotationValue dispatcherTypesValue = annotation.value("dispatcherTypes");
                if (dispatcherTypesValue != null) {
                    for (String dispatcherValue : dispatcherTypesValue.asEnumArray()) {
                        dispatchers.add(DispatcherType.valueOf(dispatcherValue));
                    }
                }
                if (dispatchers.size() > 0) {
                    filterMapping.setDispatchers(dispatchers);
                }
                if (urlPatterns.size() > 0 || servletNames.size() > 0) {
                    filterMappings.add(filterMapping);
                }
            }
View Full Code Here

   private void assertFilterMappings(WebMetaData webApp)
      throws Exception
   {
      List<FilterMappingMetaData> mappings = webApp.getFilterMappings();
      assertEquals(2, mappings.size());
      FilterMappingMetaData m0 = mappings.get(0);
      assertEquals("filter0-mapping", m0.getId());
      assertEquals("filter0Name", m0.getFilterName());
      assertEquals(null, m0.getServletNames());
      assertEquals(2, m0.getUrlPatterns().size());
      assertEquals("/filter0/*", m0.getUrlPatterns().get(0));
      assertEquals("/*", m0.getUrlPatterns().get(1));
      List<DispatcherType> dispatchers = m0.getDispatchers();
      assertEquals(2, dispatchers.size());
      assertEquals(DispatcherType.FORWARD, dispatchers.get(0));
      assertEquals(DispatcherType.REQUEST, dispatchers.get(1));
   }
View Full Code Here

                filterMappings = new ArrayList<FilterMappingMetaData>();
                webMetaData.setFilterMappings(filterMappings);
            }

            if (!filterMappingAlreadyConfigured) {
                FilterMappingMetaData filterMapping = new FilterMappingMetaData();
                filterMapping.setFilterName(rtFilter.getFilterName());
                filterMapping.setUrlPatterns(Arrays.asList("/*"));
                filterMappings.add(filterMapping);
            }
        }
    }
View Full Code Here

                            (largeIconValue == null) ? "" : largeIconValue.asString());
                if (descriptionGroup != null) {
                    filter.setDescriptionGroup(descriptionGroup);
                }
                filters.add(filter);
                FilterMappingMetaData filterMapping = new FilterMappingMetaData();
                filterMapping.setFilterName(filter.getName());
                List<String> urlPatterns = new ArrayList<String>();
                List<String> servletNames = new ArrayList<String>();
                List<DispatcherType> dispatchers = new ArrayList<DispatcherType>();
                AnnotationValue urlPatternsValue = annotation.value("urlPatterns");
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                urlPatternsValue = annotation.value();
                if (urlPatternsValue != null) {
                    for (String urlPattern : urlPatternsValue.asStringArray()) {
                        urlPatterns.add(urlPattern);
                    }
                }
                if (urlPatterns.size() > 0) {
                    filterMapping.setUrlPatterns(urlPatterns);
                }
                AnnotationValue servletNamesValue = annotation.value("servletNames");
                if (servletNamesValue != null) {
                    for (String servletName : servletNamesValue.asStringArray()) {
                        servletNames.add(servletName);
                    }
                }
                if (servletNames.size() > 0) {
                    filterMapping.setServletNames(servletNames);
                }
                AnnotationValue dispatcherTypesValue = annotation.value("dispatcherTypes");
                if (dispatcherTypesValue != null) {
                    for (String dispatcherValue : dispatcherTypesValue.asEnumArray()) {
                        dispatchers.add(DispatcherType.valueOf(dispatcherValue));
                    }
                }
                if (dispatchers.size() > 0) {
                    filterMapping.setDispatchers(dispatchers);
                }
                if (urlPatterns.size() > 0 || servletNames.size() > 0) {
                    filterMappings.add(filterMapping);
                }
            }
View Full Code Here

        JIL.setListenerClass(JSP_LISTENER);
        CPF = new FilterMetaData();
        CPF.setFilterName("Weld Conversation Propagation Filter");
        CPF.setFilterClass(CONVERSATION_FILTER);
        CPF.setAsyncSupported(true);
        CPFM = new FilterMappingMetaData();
        CPFM.setFilterName("Weld Conversation Propagation Filter");
        CPFM.setUrlPatterns(Arrays.asList("/*"));
    }
View Full Code Here

        JIL = new ListenerMetaData();
        JIL.setListenerClass(JSP_LISTENER);
        CPF = new FilterMetaData();
        CPF.setFilterName("Weld Conversation Propagation Filter");
        CPF.setFilterClass(CONVERSATION_FILTER);
        CPFM = new FilterMappingMetaData();
        CPFM.setFilterName("Weld Conversation Propagation Filter");
        CPFM.setUrlPatterns(Arrays.asList("/*"));
    }
View Full Code Here

        JIL.setListenerClass(JSP_LISTENER);
        CPF = new FilterMetaData();
        CPF.setFilterName("Weld Conversation Propagation Filter");
        CPF.setFilterClass(CONVERSATION_FILTER);
        CPF.setAsyncSupported(true);
        CPFM = new FilterMappingMetaData();
        CPFM.setFilterName("Weld Conversation Propagation Filter");
        CPFM.setUrlPatterns(Arrays.asList("/*"));
    }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.web.spec.FilterMappingMetaData

Copyright © 2018 www.massapicom. 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.