@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException{
        
        request.setCharacterEncoding("UTF-8");

        RequestData rd = getRequestData(request);

        Class clazz;
        try{
            clazz = Class.forName("models." + rd.page);
        }
        catch(ClassNotFoundException ex){
            request.setAttribute("error", ex);
            request.getRequestDispatcher("WEB-INF/pages/index.jsp").forward(request, response);
            return;     
        }

        switch (rd.action){
            case "add":
                actionAdd(request, rd, clazz);
                break;
            case "delete":
                actionDelete(request, rd, clazz);
                break;
            case "update":
                actionUpdate(request, rd, clazz);
        }
        request.setAttribute("table", helper.getTable(clazz, Long.valueOf(0)));
        request.getRequestDispatcher("WEB-INF/pages/" + rd.page + ".jsp").forward(request, response);        
    }