package web;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class FiltroB implements Filter {
public void init(FilterConfig arg0) throws ServletException { }
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException
{
System.out.println("Inizio del metodo doFilter del filtro FiltroB");
System.out.println("Il client remoto è " + request.getRemoteHost());
System.out.println("La userID inserita è " +
request.getParameter("userID"));
System.out.println("La password inserita è " +
request.getParameter("password"));
try
{
chain.doFilter(request,response);
}
catch(Exception ex)
{
ex.printStackTrace();
}
System.out.println("La servlet ha terminato la sua azione");
System.out.println("Il filtro FiltroB ripassa il controllo al " +
"filtro FiltroA");
}
public void destroy() { }
}