Java Code Examples for org.apache.catalina.deploy.FilterMap#getServletNames()

The following examples show how to use org.apache.catalina.deploy.FilterMap#getServletNames() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ApplicationFilterFactory.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Return <code>true</code> if the specified servlet name matches
 * the requirements of the specified filter mapping; otherwise
 * return <code>false</code>.
 *
 * @param filterMap Filter mapping being checked
 * @param servletName Servlet name being checked
 */
private boolean matchFiltersServlet(FilterMap filterMap, 
                                    String servletName) {

    if (servletName == null) {
        return (false);
    }
    // Check the specific "*" special servlet name
    else if (filterMap.getMatchAllServletNames()) {
        return (true);
    } else {
        String[] servletNames = filterMap.getServletNames();
        for (int i = 0; i < servletNames.length; i++) {
            if (servletName.equals(servletNames[i])) {
                return (true);
            }
        }
        return false;
    }

}
 
Example 2
Source File: ApplicationFilterFactory.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Return <code>true</code> if the specified servlet name matches
 * the requirements of the specified filter mapping; otherwise
 * return <code>false</code>.
 *
 * @param filterMap Filter mapping being checked
 * @param servletName Servlet name being checked
 */
private boolean matchFiltersServlet(FilterMap filterMap, 
                                    String servletName) {

    if (servletName == null) {
        return (false);
    }
    // Check the specific "*" special servlet name
    else if (filterMap.getMatchAllServletNames()) {
        return (true);
    } else {
        String[] servletNames = filterMap.getServletNames();
        for (int i = 0; i < servletNames.length; i++) {
            if (servletName.equals(servletNames[i])) {
                return (true);
            }
        }
        return false;
    }

}
 
Example 3
Source File: ApplicationFilterRegistration.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public Collection<String> getServletNameMappings() {
    Collection<String> result = new HashSet<String>();
    
    FilterMap[] filterMaps = context.findFilterMaps();
    
    for (FilterMap filterMap : filterMaps) {
        if (filterMap.getFilterName().equals(filterDef.getFilterName())) {
            for (String servletName : filterMap.getServletNames()) {
                result.add(servletName);
            }
        }
    }
    return result;
}
 
Example 4
Source File: ApplicationFilterRegistration.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public Collection<String> getServletNameMappings() {
    Collection<String> result = new HashSet<String>();
    
    FilterMap[] filterMaps = context.findFilterMaps();
    
    for (FilterMap filterMap : filterMaps) {
        if (filterMap.getFilterName().equals(filterDef.getFilterName())) {
            for (String servletName : filterMap.getServletNames()) {
                result.add(servletName);
            }
        }
    }
    return result;
}