public String userpass() { adminuserdao = new AdminuserDAO(); Adminuser admin = new Adminuser(); admin = (Adminuser) adminuserdao.findAll().get(0); this.result = admin.getPassword(); return SUCCESS; }
public String check() { adminuserdao = new AdminuserDAO(); userlist = adminuserdao.findAll(); Map<String, String> map = new HashMap<String, String>(); if (admin.equals(username)) { if (password.equals(userlist.get(0).getPassword())) { map.put("information", "success"); } else { map.put("information", "error1"); } } else { map.put("information", "error2"); } JSONObject jo = JSONObject.fromObject(map); this.result = jo.toString(); return SUCCESS; }