Spring Framework GenericFilterBean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework GenericFilterBean class.

This code example shows how to use the following methods:addRequiredProperty
 
public class QueryExceptionTranslationFilter extends GenericFilterBean { 
 
    protected QueryExceptionMapper exceptionMapper; 
 
    public QueryExceptionTranslationFilter() { 
        this.addRequiredProperty("exceptionMapper"); 
    } 
 
    // alright this isn't awesome. pushing spring security auth errors through our CXF handler. 
    // TODO probably be best to go with one or the other 
 
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) 
            throws IOException, ServletException { 
 
        HttpServletRequest request = (HttpServletRequest) servletRequest; 
        HttpServletResponse response = (HttpServletResponse) servletResponse; 
 
        try { 
            filterChain.doFilter(request, response); 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    public RequestCacheAwareFilter() { 
        this(new HttpSessionRequestCache()); 
    } 
 
    public RequestCacheAwareFilter(RequestCache requestCache) { 
        Assert.notNull(requestCache, "requestCache cannot be null"); 
        this.requestCache = requestCache; 
    } 
 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) 
            throws IOException, ServletException { 
 
        HttpServletRequest wrappedSavedRequest = 
            requestCache.getMatchingRequest((HttpServletRequest)request, (HttpServletResponse)response); 
 
        chain.doFilter(wrappedSavedRequest == null ? request : wrappedSavedRequest, response); 
    } 
 
    /** 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import javax.servlet.ServletResponse; 
import javax.servlet.http.HttpServletRequest; 
 
 
@Component("blEstablishSessionFilter") 
public class EstablishSessionFilter extends GenericFilterBean { 
 
    @Override 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { 
        if (HttpServletRequest.class.isAssignableFrom(request.getClass())) { 
            ((HttpServletRequest) request).getSession(); 
        } 
        filterChain.doFilter(request, response); 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * Intended for use by REST api requests. 
 *  
 * @author bpolster 
 */ 
@Component("blStatelessSessionFilter") 
public class StatelessSessionFilter extends GenericFilterBean { 
 
    @Override 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { 
        BLCRequestUtils.setOKtoUseSession(new ServletWebRequest((HttpServletRequest) request, (HttpServletResponse) response), Boolean.FALSE); 
        SessionlessHttpServletRequestWrapper wrapper = new SessionlessHttpServletRequestWrapper((HttpServletRequest) request); 
        filterChain.doFilter(wrapper, response); 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * Responsible for setting the necessary attributes on the {@link TranslationConsiderationContext}. 
 *  
 * @author Andre Azzolini (apazzolini), bpolster 
 */ 
@Component("blTranslationFilter") 
public class TranslationFilter extends GenericFilterBean { 
     
    @Resource(name = "blTranslationRequestProcessor") 
    protected TranslationRequestProcessor translationRequestProcessor; 
 
    @Override 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException { 
        try { 
            translationRequestProcessor.process(new ServletWebRequest((HttpServletRequest) request, (HttpServletResponse) response)); 
            filterChain.doFilter(request, response); 
        } finally { 
            translationRequestProcessor.postProcess(new ServletWebRequest((HttpServletRequest) request, (HttpServletResponse) response)); 
        } 
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import com.google.appengine.api.users.User; 
import com.google.appengine.api.users.UserService; 
import com.google.appengine.api.users.UserServiceFactory; 
 
@Component 
public class GoogleAuthenticationFilter extends GenericFilterBean 
{ 
	private AuthenticationManager authenticationManager; 
	private AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> ads = new WebAuthenticationDetailsSource(); 
	private AuthenticationFailureHandler authenticationFailureHandler = new SimpleUrlAuthenticationFailureHandler(); 
 
	private UserService userService = UserServiceFactory.getUserService(); 
 
	@Autowired 
	public void setAuthenticationManager(AuthenticationManager authenticationManager) 
	{ 
		this.authenticationManager = authenticationManager; 
	} 
 
	@Override 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * the authentication token is an instance of {@link org.springframework.security.providers.UsernamePasswordAuthenticationToken} 
 * </p> 
 * 
 * @author bpolster 
 */ 
public class CustomerStateFilter extends GenericFilterBean implements Ordered { 
     
    @Resource(name="blCustomerStateRequestProcessor") 
    protected CustomerStateRequestProcessor customerStateProcessor; 
 
    @Override 
    public void doFilter(ServletRequest baseRequest, ServletResponse baseResponse, FilterChain chain) throws IOException, ServletException { 
        customerStateProcessor.process(new ServletWebRequest((HttpServletRequest) baseRequest, (HttpServletResponse)baseResponse)); 
        chain.doFilter(baseRequest, baseResponse); 
    } 
 
    @Override 
    public int getOrder() { 
        //FilterChainOrder has been dropped from Spring Security 3 
        //return FilterChainOrder.REMEMBER_ME_FILTER+1; 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
import samples.gae.users.GaeUser; 
 
/** 
 * @author Luke Taylor 
 */ 
public class GaeAuthenticationFilter extends GenericFilterBean { 
    private static final String REGISTRATION_URL = "/register.htm"; 
 
    private final Logger logger = LoggerFactory.getLogger(getClass()); 
 
    private final AuthenticationDetailsSource<HttpServletRequest, WebAuthenticationDetails> ads = new WebAuthenticationDetailsSource(); 
    private AuthenticationManager authenticationManager; 
    private AuthenticationFailureHandler failureHandler = new SimpleUrlAuthenticationFailureHandler(); 
 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { 
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); 
        User googleUser = UserServiceFactory.getUserService().getCurrentUser(); 
 
        if (authentication != null && !loggedInUserMatchesGaeUser(authentication, googleUser)) { 
            SecurityContextHolder.clearContext(); 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 
    public SecurityContextPersistenceFilter() { 
        this(new HttpSessionSecurityContextRepository()); 
    } 
 
    public SecurityContextPersistenceFilter(SecurityContextRepository repo) { 
        this.repo = repo; 
    } 
 
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) 
            throws IOException, ServletException { 
        HttpServletRequest request = (HttpServletRequest) req; 
        HttpServletResponse response = (HttpServletResponse) res; 
 
        if (request.getAttribute(FILTER_APPLIED) != null) { 
            // ensure that filter is only applied once per request 
            chain.doFilter(request, response); 
            return; 
        } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
 * 
 * @see org.springframework.security.web.util.AntPathRequestMatcher 
 * 
 * @author Andre Azzolini (apazzolini) 
 */ 
public class CsrfFilter extends GenericFilterBean { 
    protected static final Log LOG = LogFactory.getLog(CsrfFilter.class); 
     
    @Resource(name="blExploitProtectionService") 
    protected ExploitProtectionService exploitProtectionService; 
 
    protected List<String> excludedRequestPatterns; 
 
    @Override 
    public void doFilter(ServletRequest baseRequest, ServletResponse baseResponse, FilterChain chain) throws IOException, ServletException { 
        HttpServletRequest request = (HttpServletRequest) baseRequest; 
        HttpServletResponse response = (HttpServletResponse) baseResponse; 
 
        boolean excludedRequestFound = false; 
        if (excludedRequestPatterns != null && excludedRequestPatterns.size() > 0) { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Spring Framework GenericFilterBean Methods: