Package com.ibatis.struts

Examples of com.ibatis.struts.ActionContext


    myList = null;
    authenticated = false;
  }

  public void validate() {
    ActionContext ctx = ActionContext.getActionContext();
    if (validation != null) {
      if (VALIDATE_EDIT_ACCOUNT.equals(validation) || VALIDATE_NEW_ACCOUNT.equals(validation)) {
        if (VALIDATE_NEW_ACCOUNT.equals(validation)) {
          account.setStatus("OK");
          validateRequiredField(account.getUsername(), "User ID is required.");
          if (account.getPassword() == null || account.getPassword().length() < 1 || !account.getPassword().equals(repeatedPassword)) {
            ctx.addSimpleError("Passwords did not match or were not provided.  Matching passwords are required.");
          }
        }
        if (account.getPassword() != null && account.getPassword().length() > 0) {
          if (!account.getPassword().equals(repeatedPassword)) {
            ctx.addSimpleError("Passwords did not match.");
          }
        }
        validateRequiredField(account.getFirstName(), "First name is required.");
        validateRequiredField(account.getLastName(), "Last name is required.");
        validateRequiredField(account.getEmail(), "Email address is required.");
View Full Code Here


    orderList = null;
    pageDirection = null;
  }

  public void validate() {
    ActionContext ctx = ActionContext.getActionContext();

    if (!this.isShippingAddressRequired()) {
      validateRequiredField(order.getCreditCard(), "FAKE (!) credit card number required.");
      validateRequiredField(order.getExpiryDate(), "Expiry date is required.");
      validateRequiredField(order.getCardType(), "Card type is required.");

      validateRequiredField(order.getShipToFirstName(), "Shipping Info: first name is required.");
      validateRequiredField(order.getShipToLastName(), "Shipping Info: last name is required.");
      validateRequiredField(order.getShipAddress1(), "Shipping Info: address is required.");
      validateRequiredField(order.getShipCity(), "Shipping Info: city is required.");
      validateRequiredField(order.getShipState(), "Shipping Info: state is required.");
      validateRequiredField(order.getShipZip(), "Shipping Info: zip/postal code is required.");
      validateRequiredField(order.getShipCountry(), "Shipping Info: country is required.");

      validateRequiredField(order.getBillToFirstName(), "Billing Info: first name is required.");
      validateRequiredField(order.getBillToLastName(), "Billing Info: last name is required.");
      validateRequiredField(order.getBillAddress1(), "Billing Info: address is required.");
      validateRequiredField(order.getBillCity(), "Billing Info: city is required.");
      validateRequiredField(order.getBillState(), "Billing Info: state is required.");
      validateRequiredField(order.getBillZip(), "Billing Info: zip/postal code is required.");
      validateRequiredField(order.getBillCountry(), "Billing Info: country is required.");
    }

    if (ctx.isSimpleErrorsExist()) {
      order.setBillAddress1(order.getShipAddress1());
      order.setBillAddress2(order.getShipAddress2());
      order.setBillToFirstName(order.getShipToFirstName());
      order.setBillToLastName(order.getShipToLastName());
      order.setBillCity(order.getShipCity());
View Full Code Here

    myList = null;
    authenticated = false;
  }

  public void validate() {
    ActionContext ctx = ActionContext.getActionContext();
    if (validation != null) {
      if (VALIDATE_EDIT_ACCOUNT.equals(validation) || VALIDATE_NEW_ACCOUNT.equals(validation)) {
        if (VALIDATE_NEW_ACCOUNT.equals(validation)) {
          account.setStatus("OK");
          validateRequiredField(account.getUsername(), "User ID is required.");
          if (account.getPassword() == null || account.getPassword().length() < 1 || !account.getPassword().equals(repeatedPassword)) {
            ctx.addSimpleError("Passwords did not match or were not provided.  Matching passwords are required.");
          }
        }
        if (account.getPassword() != null && account.getPassword().length() > 0) {
          if (!account.getPassword().equals(repeatedPassword)) {
            ctx.addSimpleError("Passwords did not match.");
          }
        }
        validateRequiredField(account.getFirstName(), "First name is required.");
        validateRequiredField(account.getLastName(), "Last name is required.");
        validateRequiredField(account.getEmail(), "Email address is required.");
View Full Code Here

    orderList = null;
    pageDirection = null;
  }

  public void validate() {
    ActionContext ctx = ActionContext.getActionContext();

    if (!this.isShippingAddressRequired()) {
      validateRequiredField(order.getCreditCard(), "FAKE (!) credit card number required.");
      validateRequiredField(order.getExpiryDate(), "Expiry date is required.");
      validateRequiredField(order.getCardType(), "Card type is required.");

      validateRequiredField(order.getShipToFirstName(), "Shipping Info: first name is required.");
      validateRequiredField(order.getShipToLastName(), "Shipping Info: last name is required.");
      validateRequiredField(order.getShipAddress1(), "Shipping Info: address is required.");
      validateRequiredField(order.getShipCity(), "Shipping Info: city is required.");
      validateRequiredField(order.getShipState(), "Shipping Info: state is required.");
      validateRequiredField(order.getShipZip(), "Shipping Info: zip/postal code is required.");
      validateRequiredField(order.getShipCountry(), "Shipping Info: country is required.");

      validateRequiredField(order.getBillToFirstName(), "Billing Info: first name is required.");
      validateRequiredField(order.getBillToLastName(), "Billing Info: last name is required.");
      validateRequiredField(order.getBillAddress1(), "Billing Info: address is required.");
      validateRequiredField(order.getBillCity(), "Billing Info: city is required.");
      validateRequiredField(order.getBillState(), "Billing Info: state is required.");
      validateRequiredField(order.getBillZip(), "Billing Info: zip/postal code is required.");
      validateRequiredField(order.getBillCountry(), "Billing Info: country is required.");
    }

    if (ctx.isSimpleErrorsExist()) {
      order.setBillAddress1(order.getShipAddress1());
      order.setBillAddress2(order.getShipAddress2());
      order.setBillToFirstName(order.getShipToFirstName());
      order.setBillToLastName(order.getShipToLastName());
      order.setBillCity(order.getShipCity());
View Full Code Here

TOP

Related Classes of com.ibatis.struts.ActionContext

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.