protected void processPasscodeEdit(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { ApplicationBean appBean = retrieveApplicationBean(); ErrorBean errorBean = new ErrorBean(); if (req.getParameter("save") != null) { String oldPasscode = req.getParameter("oldPasscode"); String newPasscode = req.getParameter("newPasscode"); String newPasscode2 = req.getParameter("newPasscode2"); if (oldPasscode.equals(appBean.getPasscode()) && newPasscode.equals(newPasscode2)) { // Update Passcode... appBean.setPasscode(newPasscode); ApplicationManager.updateApplicationBean(appBean); errorBean.addError("Passcode has been updated.", FormError.SEVERITY_STOP); req.setAttribute("errorBean", errorBean); showSettings(req, res); } else { errorBean.addError( "Old Passcode does not match. Failed to change passcode.", FormError.SEVERITY_STOP); req.setAttribute("errorBean", errorBean); showPasscodeEdit(req, res); } } else { showSettings(req, res); } }