Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.weld.util.servlet;
 
 import  javax.servlet.ServletContext;
 
Utilities for working with Servlet API.

Author(s):
Jozef Hartinger
public class ServletUtils {
    private ServletUtils() {
    }

    
Returns the right HttpContextActivationFilter. If one is set through the SPI it has precedence. Otherwise, if a mapping is set using web.xml, a new RegexHttpContextActivationFilter is constructed and returned. By default, AcceptingHttpContextActivationFilter is used.

Parameters:
manager
context
Returns:
    public static HttpContextActivationFilter getContextActivationFilter(BeanManagerImpl manager, ServletContext context) {
        HttpContextActivationFilter filter = manager.getServices().get(HttpContextActivationFilter.class);
        final String pattern = context.getInitParameter(.);
        if (filter == .) {
            // SPI has precedence. If a filter was not set through SPI let's see if a mapping is set in web.xml
            if (pattern != null) {
                return new RegexHttpContextActivationFilter(pattern);
            }
        } else if (pattern != null) {
            ..webXmlMappingPatternIgnored(pattern);
        }
        return filter;
    }
New to GrepCode? Check out our FAQ X