Package org.jboss.metadata.web.spec

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


    * @return new servlet mapping meta data
    */
   public static ServletMappingMetaData newServletMapping(final String servletName, final List<String> urlPatterns,
         final List<ServletMappingMetaData> servletMappingsMD)
   {
      final ServletMappingMetaData servletMappingMD = new ServletMappingMetaData();

      servletMappingMD.setServletName(servletName);
      servletMappingMD.setUrlPatterns(urlPatterns);
      servletMappingsMD.add(servletMappingMD);

      return servletMappingMD;
   }
View Full Code Here


     * @param servletMappingsMD servlet mapping meta data
     * @return new servlet mapping meta data
     */
    public static ServletMappingMetaData newServletMapping(final String servletName, final List<String> urlPatterns,
            final List<ServletMappingMetaData> servletMappingsMD) {
        final ServletMappingMetaData servletMappingMD = new ServletMappingMetaData();

        servletMappingMD.setServletName(servletName);
        servletMappingMD.setUrlPatterns(urlPatterns);
        servletMappingsMD.add(servletMappingMD);

        return servletMappingMD;
    }
View Full Code Here

                    mappingSet = true;
                } else {
                    JAXRS_LOGGER.noServletMappingFound(servletName);
                    return;
                }
                ServletMappingMetaData mapping = new ServletMappingMetaData();
                mapping.setServletName(servletName);
                mapping.setUrlPatterns(patterns);
                if (webdata.getServletMappings() == null) {
                    webdata.setServletMappings(new ArrayList<ServletMappingMetaData>());
                }
                webdata.getServletMappings().add(mapping);
            }

            //add a servlet named after the application class
            JBossServletMetaData servlet = new JBossServletMetaData();
            servlet.setName(servletName);
            servlet.setServletClass(HttpServlet30Dispatcher.class.getName());
            servlet.setAsyncSupported(true);
            addServlet(webdata, servlet);

        }

        if (!mappingSet) {
            //now we need tell resteasy it's relative path
            final List<ServletMappingMetaData> mappings = webdata.getServletMappings();
            if (mappings != null) {
                for (final ServletMappingMetaData mapping : mappings) {
                    if (mapping.getServletName().equals(servletName)) {
                        if (mapping.getUrlPatterns() != null) {
                            for (String pattern : mapping.getUrlPatterns()) {
                                if (mappingSet) {
                                    JAXRS_LOGGER.moreThanOneServletMapping(servletName, pattern);
                                } else {
                                    mappingSet = true;
                                    String realPattern = pattern;
View Full Code Here

        List<ServletMappingMetaData> mappings = metadata.getServletMappings();
        if (mappings == null) {
            mappings = new ArrayList<ServletMappingMetaData>();
            metadata.setServletMappings(mappings);
        }
        ServletMappingMetaData mapping = new ServletMappingMetaData();
        mapping.setUrlPatterns(Arrays.asList(names));
        mapping.setServletName(servlet);
        mappings.add(mapping);
    }
View Full Code Here

                    mappingSet = true;
                } else {
                    JAXRS_LOGGER.noServletMappingFound(servletName);
                    return;
                }
                ServletMappingMetaData mapping = new ServletMappingMetaData();
                mapping.setServletName(servletName);
                mapping.setUrlPatterns(patterns);
                if (webdata.getServletMappings() == null) {
                    webdata.setServletMappings(new ArrayList<ServletMappingMetaData>());
                }
                webdata.getServletMappings().add(mapping);
            }

            //add a servlet named after the application class
            JBossServletMetaData servlet = new JBossServletMetaData();
            servlet.setName(servletName);
            servlet.setServletClass(HttpServlet30Dispatcher.class.getName());
            servlet.setAsyncSupported(true);
            addServlet(webdata, servlet);

        }

        if (!mappingSet) {
            //now we need tell resteasy it's relative path
            final List<ServletMappingMetaData> mappings = webdata.getServletMappings();
            if (mappings != null) {
                for (final ServletMappingMetaData mapping : mappings) {
                    if (mapping.getServletName().equals(servletName)) {
                        if (mapping.getUrlPatterns() != null) {
                            for (String pattern : mapping.getUrlPatterns()) {
                                if (mappingSet) {
                                    JAXRS_LOGGER.moreThanOneServletMapping(servletName, pattern);
                                } else {
                                    mappingSet = true;
                                    String realPattern = pattern;
View Full Code Here

                    mappingSet = true;
                } else {
                    JAXRS_LOGGER.noServletMappingFound(servletName);
                    return;
                }
                ServletMappingMetaData mapping = new ServletMappingMetaData();
                mapping.setServletName(servletName);
                mapping.setUrlPatterns(patterns);
                if (webdata.getServletMappings() == null) {
                    webdata.setServletMappings(new ArrayList<ServletMappingMetaData>());
                }
                webdata.getServletMappings().add(mapping);
            }

            //add a servlet named after the application class
            JBossServletMetaData servlet = new JBossServletMetaData();
            servlet.setName(servletName);
            servlet.setServletClass(HttpServlet30Dispatcher.class.getName());
            servlet.setAsyncSupported(true);
            addServlet(webdata, servlet);

        }

        if (!mappingSet) {
            //now we need tell resteasy it's relative path
            final List<ServletMappingMetaData> mappings = webdata.getServletMappings();
            if (mappings != null) {
                for (final ServletMappingMetaData mapping : mappings) {
                    if (mapping.getServletName().equals(servletName)) {
                        if (mapping.getUrlPatterns() != null) {
                            for (String pattern : mapping.getUrlPatterns()) {
                                if (mappingSet) {
                                    JAXRS_LOGGER.moreThanOneServletMapping(servletName, pattern);
                                } else {
                                    mappingSet = true;
                                    String realPattern = pattern;
View Full Code Here

         if (servletMappings == null)
         {
            servletMappings = new ArrayList<ServletMappingMetaData>();
            jbwmd.setServletMappings(servletMappings);
         }
         ServletMappingMetaData servletMapping = new ServletMappingMetaData();
         servletMapping.setServletName(ep.getShortName());
         servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
         servletMappings.add(servletMapping);
      }

      String authMethod = null;
View Full Code Here

                            (smallIconValue == null) ? "" : smallIconValue.asString(),
                            (largeIconValue == null) ? "" : largeIconValue.asString());
                if (descriptionGroup != null) {
                    servlet.setDescriptionGroup(descriptionGroup);
                }
                ServletMappingMetaData servletMapping = new ServletMappingMetaData();
                servletMapping.setServletName(servlet.getName());
                List<String> urlPatterns = new ArrayList<String>();
                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) {
                    servletMapping.setUrlPatterns(urlPatterns);
                    servletMappings.add(servletMapping);
                }
                servlets.add(servlet);
            }
            metaData.setServlets(servlets);
View Full Code Here

        List<ServletMappingMetaData> mappings = metadata.getServletMappings();
        if(mappings == null) {
            mappings = new ArrayList<ServletMappingMetaData>();
            metadata.setServletMappings(mappings);
        }
        ServletMappingMetaData mapping = new ServletMappingMetaData();
        mapping.setUrlPatterns(Arrays.asList(names));
        mapping.setServletName(servlet);
        mappings.add(mapping);
    }
View Full Code Here

         if (servletMappings == null)
         {
            servletMappings = new ArrayList<ServletMappingMetaData>();
            jbwmd.setServletMappings(servletMappings);
         }
         ServletMappingMetaData servletMapping = new ServletMappingMetaData();
         servletMapping.setServletName(ep.getShortName());
         servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
         servletMappings.add(servletMapping);
      }

      String authMethod = null;
View Full Code Here

TOP

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

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.