private RequestDispatcher goSetting(HttpServletRequest request, HttpServletResponse response) throws ServletException{
        if(request.getParameter("oldpwd")!=null&&request.getParameter("newpwd")!=null&&request.getParameter("newpwd2")!=null){
            try {
                if(DB.passwordCorretta(((Utente)request.getSession().getAttribute("user")).getUsername(), request.getParameter("oldpwd"))){
                    if(request.getParameter("newpwd").equals(request.getParameter("newpwd2"))){
                        DB.editUser(((Utente)request.getSession().getAttribute("user")).getUsername(), request.getParameter("newpwd"));
                    request.setAttribute("result", "ok");
                    }
                    else{
                         request.setAttribute("result", "badnew");
                    }
                    
                }
                else{
                    request.setAttribute("result", "badpwd");
                }
            } catch (SQLException ex) {
               throw new ServletException(ex);
            }
        }    
        return getServletContext().getRequestDispatcher("/setting.jsp");
    }