Package net.sourceforge.pebble.web.view.impl

Examples of net.sourceforge.pebble.web.view.impl.ChangePasswordView


      if (!currentUserDetails.isDetailsUpdateable()) {
        return new ForbiddenView();
      }

      if (submit == null || submit.length() == 0) {
        return new ChangePasswordView();
      }

      ValidationContext validationContext = new ValidationContext();

      if (password1 == null || password1.length() == 0) {
        validationContext.addError("Password can not be empty");
      } else if (!password1.equals(password2)) {
        validationContext.addError("Passwords do not match");
      }

      if (!validationContext.hasErrors()) {
          realm.changePassword(currentUserDetails.getUsername(), password1);

          return new PasswordChangedView();
      }

      getModel().put("validationContext", validationContext);
      return new ChangePasswordView();
    } catch (SecurityRealmException e) {
      throw new ServletException(e);
    }
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.pebble.web.view.impl.ChangePasswordView

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.