src/java/Exception/TratamentoExcecao.java
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Exception excecao = (Exception) request.getAttribute("javax.servlet.error.exception");
        Integer codigoStatus = (Integer) request.getAttribute("javax.servlet.error.status_code");
        String nomeServlet = (String) request.getAttribute("javax.servlet.error.servlet_name");
        String uriRequisicao = (String) request.getAttribute("javax.servlet.error.request_uri");

        request.setAttribute("codigoStatus", codigoStatus);
        request.setAttribute("nomeServlet", nomeServlet);
        request.setAttribute("uriRequisicao", uriRequisicao);
        if (excecao != null) {
            request.setAttribute("tipoExcecao", excecao.getClass().getName());
            request.setAttribute("mensagem", excecao.getMessage());
        }
        RequestDispatcher view = request.getRequestDispatcher("/erro.jsp");
        view.forward(request, response);

    }
/**
     * Processes requests for both HTTP <code>GET</code> and <code>POST</code>
     * methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
Processes requests for both HTTP GET and POST
methods.

@param request servlet request
@param response servlet response
@throws ServletException if a servlet-specific error occurs
@throws IOException if an I/O error occurs
Processes requests for both HTTP GET and POST methods . @param request servlet request @param response servlet response @throws ServletException if a servlet - specific error occurs @throws IOException if an I / O error occurs
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        Exception excecao = (Exception) request.getAttribute("javax.servlet.error.exception");
        Integer codigoStatus = (Integer) request.getAttribute("javax.servlet.error.status_code");
        String nomeServlet = (String) request.getAttribute("javax.servlet.error.servlet_name");
        String uriRequisicao = (String) request.getAttribute("javax.servlet.error.request_uri");
        request.setAttribute("codigoStatus", codigoStatus);
        request.setAttribute("nomeServlet", nomeServlet);
        request.setAttribute("uriRequisicao", uriRequisicao);
        if (excecao != null) {
            request.setAttribute("tipoExcecao", excecao.getClass().getName());
            request.setAttribute("mensagem", excecao.getMessage());
        }
        RequestDispatcher view = request.getRequestDispatcher("/erro.jsp");
        view.forward(request, response);
    }
protected void processRequest ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { Exception excecao = ( Exception ) request . getAttribute ( "javax.servlet.error.exception" ) ; Integer codigoStatus = ( Integer ) request . getAttribute ( "javax.servlet.error.status_code" ) ; String nomeServlet = ( String ) request . getAttribute ( "javax.servlet.error.servlet_name" ) ; String uriRequisicao = ( String ) request . getAttribute ( "javax.servlet.error.request_uri" ) ; request . setAttribute ( "codigoStatus" , codigoStatus ) ; request . setAttribute ( "nomeServlet" , nomeServlet ) ; request . setAttribute ( "uriRequisicao" , uriRequisicao ) ; if ( excecao != null ) { request . setAttribute ( "tipoExcecao" , excecao . getClass ( ) . getName ( ) ) ; request . setAttribute ( "mensagem" , excecao . getMessage ( ) ) ; } RequestDispatcher view = request . getRequestDispatcher ( "/erro.jsp" ) ; view . forward ( request , response ) ; }
Processes requests for both HTTP <code>GET</code> and <code>POST</code>
 methods.
Processes requests for both HTTP <code > GET< / code > and <code > POST< / code > methods .