Examples of servletNames()


Examples of javax.servlet.annotation.WebFilter.servletNames()

            if (urlPatterns != null) {
                for (int i = 0; i < urlPatterns.length; i++) {
                    filterMap.addURLPattern(urlPatterns[i]);
                }
            }
            String[] servletNames = annotation.servletNames();
            if (servletNames != null) {
                for (int i = 0; i < servletNames.length; i++) {
                    filterMap.addServletName(servletNames[i]);
                }
            }
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

            boolean valueAttributeConfigured = webFilter.value().length > 0;
            boolean urlPatternsAttributeConfigured = webFilter.urlPatterns().length > 0;
            if (valueAttributeConfigured && urlPatternsAttributeConfigured) {
                throw new DeploymentException("value and urlPatterns must not be configured on the same WebFilter annotation in the class " + cls.getName());
            }
            boolean servletNamesAttributeConfigured = webFilter.servletNames().length == 0;
            if (!valueAttributeConfigured && !urlPatternsAttributeConfigured && !servletNamesAttributeConfigured) {
                throw new DeploymentException("At least one of value, urlPatterns and servletNames attributes are configured on the WebFilter annotation in the class " + cls.getName());
            }
            String[] urlPatterns = valueAttributeConfigured ? webFilter.value() : webFilter.urlPatterns();
            if (FilterMergeHandler.isFilterConfigured(filterName, mergeContext)) {
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

            //filter-mapping configured in web.xml and web-fragment.xml will override the configurations from annotation
            if (!FilterMappingMergeHandler.isFilterMappingConfigured(filterName, mergeContext)) {
                //create filter-mapping element
                FilterMapping filterMapping = new FilterMapping();
                filterMapping.setFilterName(filterName);
                for (String servletName : webFilter.servletNames()) {
                    filterMapping.getServletName().add(servletName);
                }
                for (DispatcherType dispatcherType : webFilter.dispatcherTypes()) {
                    filterMapping.getDispatcher().add(Dispatcher.fromValue(dispatcherType.name()));
                }
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

            boolean valueAttributeConfigured = webFilter.value().length > 0;
            boolean urlPatternsAttributeConfigured = webFilter.urlPatterns().length > 0;
            if (valueAttributeConfigured && urlPatternsAttributeConfigured) {
                throw new DeploymentException("value and urlPatterns must not be configured on the same WebFilter annotation in the class " + cls.getName());
            }
            boolean servletNamesAttributeConfigured = webFilter.servletNames().length == 0;
            if (!valueAttributeConfigured && !urlPatternsAttributeConfigured && !servletNamesAttributeConfigured) {
                throw new DeploymentException("At least one of value, urlPatterns and servletNames attributes are configured on the WebFilter annotation in the class " + cls.getName());
            }
            String[] urlPatterns = valueAttributeConfigured ? webFilter.value() : webFilter.urlPatterns();
            if (FilterMergeHandler.isFilterConfigured(filterName, mergeContext)) {
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

            //filter-mapping configured in web.xml and web-fragment.xml will override the configurations from annotation
            if (!FilterMappingMergeHandler.isFilterMappingConfigured(filterName, mergeContext)) {
                //create filter-mapping element
                FilterMappingType filterMapping = webApp.addNewFilterMapping();
                filterMapping.addNewFilterName().setStringValue(filterName);
                for (String servletName : webFilter.servletNames()) {
                    filterMapping.addNewServletName().setStringValue(servletName);
                }
                for (DispatcherType dispatcherType : webFilter.dispatcherTypes()) {
                    filterMapping.addNewDispatcher().setStringValue(dispatcherType.name());
                }
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

                        urlPatternString));
            }
        }

        if (!hasServletName) {
            String[] servletNames = webFilterAn.servletNames();
            if (servletNames != null && servletNames.length > 0) {
                for (String sn : servletNames) {
                    servletFilterMappingDesc.addServletName(sn);
                }
            }
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

                    paths.add(Util.normalizePattern(s));
                }
                mapping.setPathSpecs(paths.toArray(new String[paths.size()]));
            }

            if (filterAnnotation.servletNames().length > 0)
            {
                ArrayList<String> names = new ArrayList<String>();
                for (String s : filterAnnotation.servletNames())
                {
                    names.add(s);
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

            }

            if (filterAnnotation.servletNames().length > 0)
            {
                ArrayList<String> names = new ArrayList<String>();
                for (String s : filterAnnotation.servletNames())
                {
                    names.add(s);
                }
                mapping.setServletNames(names.toArray(new String[names.size()]));
            }
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

                    {
                        paths.add(Util.normalizePattern(s));
                    }
                    mapping.setPathSpecs(paths.toArray(new String[paths.size()]));
                }
                if (filterAnnotation.servletNames().length > 0)
                {
                    ArrayList<String> names = new ArrayList<String>();
                    for (String s : filterAnnotation.servletNames())
                    {
                        names.add(s);
View Full Code Here

Examples of javax.servlet.annotation.WebFilter.servletNames()

                    mapping.setPathSpecs(paths.toArray(new String[paths.size()]));
                }
                if (filterAnnotation.servletNames().length > 0)
                {
                    ArrayList<String> names = new ArrayList<String>();
                    for (String s : filterAnnotation.servletNames())
                    {
                        names.add(s);
                    }
                    mapping.setServletNames(names.toArray(new String[names.size()]));
                }
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.