@Override
  public void doPost(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.setContentType("text/html");
    HttpSession session = request.getSession();

    String name = request.getParameter("name");
    String ID = request.getParameter("ID");
    String email = request.getParameter("email");
    String password = request.getParameter("password");
    String position = request.getParameter("position");

    try {
      MD5Util.addNewStaff(name, Integer.parseInt(ID), email, password, position);
      session.setAttribute("AddStaff", "Yes");
    } catch (Exception e) {
      session.setAttribute("AddStaff", "No");
    }

    response.sendRedirect("/library/people.jsp");
  }
Example #2
0
 public static void main(String[] args) {
   System.out.print(MD5Util.calc(""));
 }