Example usage for javax.servlet FilterChain doFilter

List of usage examples for javax.servlet FilterChain doFilter

Introduction

In this page you can find the example usage for javax.servlet FilterChain doFilter.

Prototype

public void doFilter(ServletRequest request, ServletResponse response) throws IOException, ServletException;

Source Link

Document

Causes the next filter in the chain to be invoked, or if the calling filter is the last filter in the chain, causes the resource at the end of the chain to be invoked.

Usage

From source file:edu.sdsc.scigraph.services.auth.BasicAuthFilter.java

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    chain.doFilter(new FilteredRequest((HttpServletRequest) request), response);
}

From source file:com.appeligo.search.actions.SessionCreatorFilter.java

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    ((HttpServletRequest) request).getSession();
    chain.doFilter(request, response);
}

From source file:grails.plugin.snakecaseparams.SnakecaseParamsFilter.java

public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
        throws IOException, ServletException {

    FilteredRequest filteredRequest = new FilteredRequest(request);
    filterChain.doFilter(filteredRequest, response);
}

From source file:org.apache.nifi.minifi.c2.security.authentication.X509AuthenticationFilter.java

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    authenticateIfPossible(request);/*from  ww w .ja  va  2  s  . c om*/
    chain.doFilter(request, response);
}

From source file:FilterParameter.java

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {

    System.out.println("The message is: " + filterConfig.getInitParameter("message"));
    chain.doFilter(request, response);
}

From source file:com.iflytek.edu.cloud.frame.web.filter.HttpRequestRateLimiterFilter.java

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    if (limiter.tryAcquire()) {
        chain.doFilter(request, response);
    } else {/*  w  w w.  j av a  2 s .  c o m*/
        ((HttpServletResponse) response).sendError(429, "http");
    }
}

From source file:com.pcms.filter.XssFilter.java

@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    if (isExcludeUrl(request)) {
        chain.doFilter(request, response);
    } else {//w w  w .j a va2 s  .  com
        chain.doFilter(new XssHttpServletRequestWrapper((HttpServletRequest) request, _filterChar, _replaceChar,
                _splitChar), response);
    }
}

From source file:sample.session.SessionDetailsFilter.java

public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    chain.doFilter(request, response);

    HttpSession session = request.getSession(false);
    if (session != null) {
        String remoteAddr = getRemoteAddress(request);
        String geoLocation = getGeoLocation(remoteAddr);

        SessionDetails details = new SessionDetails();
        details.setAccessType(request.getHeader("User-Agent"));
        details.setLocation(remoteAddr + " " + geoLocation);

        session.setAttribute("SESSION_DETAILS", details);
    }/*from w w w. j  ava2 s  . c  om*/
}

From source file:com.haulmont.cuba.web.sys.CubaHttpFilter.java

protected void handleNotFiltered(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
        throws IOException, ServletException {
    chain.doFilter(request, response);
}

From source file:carbonfive.spring.web.pathparameter.ParameterizedPathFilter.java

/**
 * Wraps the request with one that will add request parameters when given a request attribute
 * with the appropriate key./*from   w  ww. j a  v  a2  s  .  c o m*/
 *
 * @param request     Request
 * @param response    Response
 * @param filterChain Chain
 * @throws IOException
 * @throws ServletException
 */
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response,
        FilterChain filterChain) throws ServletException, IOException {
    filterChain.doFilter(new ParameterizedPathServletRequest(request), response);
}