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

        if (debug) {
            log("filtroAutenticacion:doFilter()");
        }

        doBeforeProcessing(request, response);

        Throwable problem = null;
        try {
            HttpSession oSession = ((HttpServletRequest) request).getSession();
            UsuarioBean oUsuarioBean = (UsuarioBean) oSession.getAttribute("usuarioBean");
            if (oUsuarioBean == null)//no hay sesión
            {
                //Contexto oContexto = new Contexto();
                //oContexto.setVista("jsp/usuario/login.jsp");
                //request.setAttribute("contexto", oContexto);
                //HttpServletResponse httpResponse = (HttpServletResponse) response;
                //httpResponse.sendRedirect("/Controller?class=usuario&method=login");
                HttpServletRequest http = (HttpServletRequest) request;
                RequestDispatcher disp = http.getRequestDispatcher("/forbidden.html");
                disp.forward(request, response);
            } else {
                chain.doFilter(request, response);
            }

        } catch (Throwable t) {
            // If an exception is thrown somewhere down the filter chain,
            // we still want to execute our after processing, and then
            // rethrow the problem after that.
            problem = t;
            t.printStackTrace();
        }

        doAfterProcessing(request, response);

        // If there was a problem, we want to rethrow it if it is
        // a known type, otherwise log it.
        if (problem != null) {
            if (problem instanceof ServletException) {
                throw (ServletException) problem;
            }
            if (problem instanceof IOException) {
                throw (IOException) problem;
            }
            sendProcessingError(problem, response);
        }
    }