KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > acme > AcmeAction


1 /*
2  * AcmeAction.java
3  *
4  * Copyright (C) 2002 Proact Corp.
5  * All rights reserved.
6  */

7
8 package com.acme;
9
10 import javax.servlet.ServletException JavaDoc;
11 import javax.servlet.http.HttpServletRequest JavaDoc;
12 import javax.servlet.http.HttpServletResponse JavaDoc;
13
14 import org.apache.struts.action.ActionError;
15 import org.apache.struts.action.ActionErrors;
16 import org.apache.struts.action.ActionForm;
17 import org.apache.struts.action.ActionForward;
18 import org.apache.struts.action.ActionMapping;
19
20 /*********************************************************************
21  *
22  * Description of class
23  *
24  * @author Nick Afshartous <nick.afshartous@proactcorp.com>
25  *
26  * @version $Id: AcmeAction.java,v 1.2 2003/02/20 14:17:35 afshar Exp $
27  *
28  *********************************************************************/

29
30 public class AcmeAction extends org.apache.struts.actions.DispatchAction {
31
32
33     /*
34      * Show the home page
35      *
36      * @param mapping The ActionMapping used to select this instance
37      * @param actionForm The ActionForm bean for this request
38      * @param request The HTTP request we are processing
39      * @param response The HTTP response we are creating
40      */

41     public ActionForward enterName(ActionMapping mapping,
42                                    ActionForm form,
43                                    HttpServletRequest JavaDoc request,
44                                    HttpServletResponse JavaDoc response)
45         throws Exception JavaDoc {
46
47         return mapping.findForward("name");
48
49     }
50
51
52     public ActionForward enterAddress(ActionMapping mapping,
53                                     ActionForm form,
54                                     HttpServletRequest JavaDoc request,
55                                     HttpServletResponse JavaDoc response)
56         throws Exception JavaDoc {
57
58         return mapping.findForward("address");
59
60     }
61
62
63     public ActionForward submitAddress(ActionMapping mapping,
64                                        ActionForm form,
65                                        HttpServletRequest JavaDoc request,
66                                        HttpServletResponse JavaDoc response)
67         throws Exception JavaDoc {
68
69         return mapping.findForward("done");
70
71     }
72
73
74     public ActionForward previous(ActionMapping mapping,
75                                   ActionForm form,
76                                   HttpServletRequest JavaDoc request,
77                                   HttpServletResponse JavaDoc response)
78         throws Exception JavaDoc {
79
80         return mapping.findForward("previous");
81
82     }
83
84 }
85
86
87
88
89
Popular Tags