Posted by: Rajaganesh Vanarajan on: November 6, 2008
This post is aimed at helping some small web application developers to secure their resources from unauthorized access. Just write a filter like this,
public class AuthenticationFilter implements Filter {
private FilterConfig config = null;
public void init(FilterConfig config) throws
ServletException {this.config = config;
}
public void destroy() {
config = null;
}
/*
* FILTER METHOD
*/
public void doFilter(ServletRequest request, ServletResponse response,FilterChain chain) throws IOException, [...]