@RequestMapping(value = "/change/passwd", method = RequestMethod.POST) // add post when deployed public String changePasswd(HttpSession session, @RequestParam(value = "passwd") String passwd) throws JSONException { String type = (String) session.getAttribute("type"); if (type != null) { int id = (Integer) session.getAttribute("id"); userService.updatePassword(id, passwd, type); } return "redirect:/dash"; }