setCurrentPin(null); setNewPin(null);
    public void changePin(IRequestCycle cycle_) {        // Proceed only if Tapestry validation succeeded        if (!TapestryUtils.isValid(this)) {            return;        }        // Get the userId.  Note that the Border component of the page ensures        // that the user is logged in and therefore that userId is non-null.        Visit visit = (Visit) getPage().getVisit();        Integer userId = visit.getUserId();        // Validate the current PIN.        // Note that the ConfirmPassword component ensures that the new PIN and        // confirm new PIN fields match, so we don't have to worry about that here.                CoreContext coreContext = getCoreContext();        User user = coreContext.loadUser(userId);        LoginContext loginContext = getLoginContext();                // If the currentPin is null, then make it the empty string        String currentPin = (String) ObjectUtils.defaultIfNull(getCurrentPin(), StringUtils.EMPTY);                user = loginContext.checkCredentials(user.getUserName(), currentPin);        if (user == null) {            IValidationDelegate delegate = TapestryUtils.getValidator(this);            delegate.record(getMessage("message.badCurrentPin"), ValidationConstraint.CONSISTENCY);            return;        }        // The new PIN is not allowed to be empty        if (StringUtils.isEmpty(getNewPin())) {            IValidationDelegate delegate = TapestryUtils.getValidator(this);            delegate.record(getMessage("message.emptyNewPin"), ValidationConstraint.REQUIRED);            return;                    }                // Change the PIN        user.setPin(getNewPin(), coreContext.getAuthorizationRealm());        coreContext.saveUser(user);                // TODO: Provide a success message confirming the PIN change,        // when the mechanism for success messages becomes available.    }