KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quikj > application > communicator > admin > controller > LogDeleteForm


1 /*
2  * LogDeleteForm.java
3  *
4  * Created on June 4, 2003, 11:06 AM
5  */

6
7 package com.quikj.application.communicator.admin.controller;
8
9 import java.util.*;
10
11 import org.apache.struts.action.*;
12 import javax.servlet.http.HttpServletRequest JavaDoc;
13 import java.text.SimpleDateFormat JavaDoc;
14 /**
15  *
16  * @author bhm
17  */

18 public class LogDeleteForm extends ActionForm
19 {
20     
21     /** Holds value of property priorToInput. */
22     private String JavaDoc priorToInput;
23     
24     /** Holds value of property priorToDate. */
25     private Date priorToDate;
26     
27     /** Creates a new instance of LogDeleteForm */
28     public LogDeleteForm()
29     {
30         reset();
31     }
32     
33     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request)
34     {
35         ActionErrors errors = new ActionErrors();
36         
37         Date date = DateUtility.processInputDate(priorToInput);
38         if (date == null)
39         {
40             errors.add("priorToInput", new ActionError("error.date.invalid", ""));
41         }
42         else
43         {
44             priorToDate = date;
45         }
46         
47         
48         return errors;
49     }
50     
51     public void reset()
52     {
53         Calendar cal = Calendar.getInstance();
54         cal.add(Calendar.MONTH, -1);
55         
56         SimpleDateFormat JavaDoc formatter = new SimpleDateFormat JavaDoc("MM/dd/yyyy");
57         
58         priorToInput = formatter.format(cal.getTime());
59         priorToDate = null;
60     }
61     
62     /** Getter for property priorToInput.
63      * @return Value of property priorToInput.
64      *
65      */

66     public String JavaDoc getPriorToInput()
67     {
68         return this.priorToInput;
69     }
70     
71     /** Setter for property priorToInput.
72      * @param priorToInput New value of property priorToInput.
73      *
74      */

75     public void setPriorToInput(String JavaDoc priorToInput)
76     {
77         this.priorToInput = priorToInput;
78     }
79     
80     /** Getter for property priorToDate.
81      * @return Value of property priorToDate.
82      *
83      */

84     public Date getPriorToDate()
85     {
86         return this.priorToDate;
87     }
88     
89     /** Setter for property priorToDate.
90      * @param priorToDate New value of property priorToDate.
91      *
92      */

93     public void setPriorToDate(Date priorToDate)
94     {
95         this.priorToDate = priorToDate;
96     }
97     
98 }
99
Popular Tags