1 package xpetstore.web.struts.action.signon; 2 3 import javax.servlet.http.HttpServletRequest ; 4 5 import org.apache.struts.action.ActionErrors; 6 import org.apache.struts.action.ActionMapping; 7 8 import xpetstore.domain.signon.ejb.Account; 9 10 import xpetstore.web.struts.action.*; 11 12 13 19 public class SignonForm 20 extends BaseForm 21 { 22 24 private Account _account = new Account( ); 25 26 28 public ActionErrors validate( ActionMapping mapping, 29 HttpServletRequest request ) 30 { 31 ActionErrors errors = new ActionErrors( ); 32 33 checkNotEmpty( _account.getUserId( ), "userId_required", errors ); 34 checkNotEmpty( _account.getPassword( ), "password_required", errors ); 35 36 return errors; 37 } 38 39 public Account getAccount( ) 40 { 41 return _account; 42 } 43 44 public void setAccount( Account account ) 45 { 46 _account = account; 47 } 48 } 49 | Popular Tags |