chapter_007/src/main/java/ru/job4j/servlets/UserDeleteServlet.java
/**
     * Delete the user from DB abd redirect on the home.
     *
     * @param req  - HttpServletRequest.
     * @param resp - HttpServletResponse.
     * @throws IOException - IOException.
     */
Delete the user from DB abd redirect on the home.
@param req  - HttpServletRequest.
@param resp - HttpServletResponse.
Delete the user from DB abd redirect on the home . @param req - HttpServletRequest . @param resp - HttpServletResponse .
@Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
        try {
            this.vs.delete(Integer.parseInt(req.getParameter("id")));
        } catch (IncorrectDateException e) {
            e.getMessage();
            resp.sendError(406, e.getMessage());
        }
        resp.sendRedirect(String.format("%s/", req.getContextPath()));
    }
@ Override protected void doPost ( HttpServletRequest req , HttpServletResponse resp ) throws IOException { try { this . vs . delete ( Integer . parseInt ( req . getParameter ( "id" ) ) ) ; } catch ( IncorrectDateException e ) { e . getMessage ( ) ; resp . sendError ( 406 , e . getMessage ( ) ) ; } resp . sendRedirect ( String . format ( "%s/" , req . getContextPath ( ) ) ) ; }
Delete the user from DB abd redirect on the home.
Delete the user from DB abd redirect on the home .