コード例 #1
0
 public Resolution newAccount() {
   accountService.insertAccount(account);
   account = accountService.getAccount(account.getUsername());
   myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
   authenticated = true;
   return new RedirectResolution(CatalogActionBean.class);
 }
コード例 #2
0
  public Resolution signon() {

    account = accountService.getAccount(getUsername(), getPassword());

    if (account == null) {
      String value = "Invalid username or password.  Signon failed.";
      setMessage(value);
      clear();
      return new ForwardResolution(SIGNON);
    } else {
      account.setPassword(null);
      myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
      authenticated = true;
      HttpSession s = context.getRequest().getSession();
      // this bean is already registered as /actions/Account.action
      s.setAttribute("accountBean", this);
      return new RedirectResolution(CatalogActionBean.class);
    }
  }
コード例 #3
0
 public Resolution editAccount() {
   accountService.updateAccount(account);
   account = accountService.getAccount(account.getUsername());
   myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
   return new RedirectResolution(CatalogActionBean.class);
 }