Exemplo n.º 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);
 }
Exemplo n.º 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);
    }
  }
Exemplo n.º 3
0
 public Resolution editAccount() {
   accountService.updateAccount(account);
   account = accountService.getAccount(account.getUsername());
   myList = catalogService.getProductListByCategory(account.getFavouriteCategoryId());
   return new RedirectResolution(CatalogActionBean.class);
 }