Package org.netbeans.modules.j2ee.dd.api.web

Examples of org.netbeans.modules.j2ee.dd.api.web.FilterMapping


        protected FilterMapping addFilterMapping(WebApp webApp, String filterName,
                String mappingValue, FilterMappingType mappingType,
                FilterMappingDispatcher mappingDispatcher) throws IOException {

            FilterMapping mapping = (FilterMapping) createBean(webApp, "FilterMapping");
            mapping.setFilterName(filterName);
            switch(mappingType){
                case SERVLET_NAME:
                    mapping.setServletName(mappingValue);
                    break;
                case URL_PATTERN:
                    mapping.setUrlPattern(mappingValue);
                    break;
                default:
                    throw new IllegalArgumentException("Not supported filter " +
                            "mapping type");
            }

            try {
                mapping.setDispatcher(new String[] {mappingDispatcher.toString()});
            } catch (VersionNotSupportedException ve){
                log.warning(ve.getMessage());
            }

            webApp.addFilterMapping(mapping);
View Full Code Here

TOP

Related Classes of org.netbeans.modules.j2ee.dd.api.web.FilterMapping

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.