Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.weld.servlet.spi.helpers;
 
 
 import  javax.servlet.http.HttpServletRequest;
 
A helper implementation of HttpContextActivationFilter that accepts every request that matches a predefined regular expression.

Author(s):
Jozef Hartinger
    private final Pattern pattern;
    public RegexHttpContextActivationFilter(Pattern pattern) {
        this. = pattern;
    }
    public RegexHttpContextActivationFilter(String regex) {
        this. = Pattern.compile(regex);
    }
    @Override
    public boolean accepts(HttpServletRequest request) {
        final String path = request.getRequestURI().substring(request.getContextPath().length());
        return .matcher(path).matches();
    }
    @Override
    public void cleanup() {
    }
New to GrepCode? Check out our FAQ X