/** * Sends the current log in object to the EJB * * @return Will either return the user to the log in page (if creation was successful) OR will * return user back to the register page with an error message * @throws NoSuchAlgorithmException This error is thrown if the password encryption fails */ public String createUser() throws NoSuchAlgorithmException { if (!detentionTrackerBean.userExists(currentLogin.getUsername())) { // If new username does not already exists... detentionTrackerBean.createInitialLogin(currentLogin); return "login?faces-redirect=true"; } // else if it does already exists... displayMessage( "Username already exists OR you have entered incorrect characters (letters & numbers only!)"); return null; }