KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xpetstore > web > struts > action > signon > SignonForm


1 package xpetstore.web.struts.action.signon;
2
3 import javax.servlet.http.HttpServletRequest JavaDoc;
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 /**
14  * @author <a HREF="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
15  *
16  * @struts.form
17  * name="signonForm"
18  */

19 public class SignonForm
20     extends BaseForm
21 {
22     //~ Instance fields --------------------------------------------------------
23

24     private Account _account = new Account( );
25
26     //~ Methods ----------------------------------------------------------------
27

28     public ActionErrors validate( ActionMapping mapping,
29                                   HttpServletRequest JavaDoc 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