protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        
        String rid = request.getParameter("rid");
        String rname = request.getParameter("rname");
        
        response.setContentType("text/html;charset=UTF-8");
        try (PrintWriter out = response.getWriter()) {
            /* TODO output your page here. You may use following sample code. */
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet EditRoleServlet</title>");     
            out.println("<link rel=\"stylesheet\" href=\"css/style.css\"/>");       
            out.println("</head>");
            out.println("<body>");
            out.println("<div class=\"main\">");
            
            if (rname == null) {
                out.println("<form method=\"POST\">");
                out.println("<label>Role ID " + rid + "</label>");

                Role rf = rfl.find(Long.parseLong(rid));

                out.println("<input type=\"text\" id=\"name\" name=\"rname\" value= " + rf.getName() + ">");
                out.println("<button type=\"submit\" name=\"btn\" value=\"val\">Ok</button>");
                out.println("</form>");
                out.println("<a class=\"go-back\" href=\"index.html\">Home</a>");
            } else {
                Role uf = rfl.find(Long.parseLong(rid));
                uf.setName(rname);
                rfl.edit(uf);
                response.sendRedirect("listrole");
            }
            out.println("</div>");
            out.println("</body>");
            out.println("</html>");
        }
    }