KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mdarad > framework > util > struts > action > MdaradActionForm


1 /*
2     Mdarad-Toolobox is a collection of tools for Architected RAD
3     (Rapid Application Development) based on an MDA approach.
4     The toolbox contains frameworks and generators for many environments
5     (JAVA, J2EE, Hibernate, .NET, C++, etc.) which allow to generate
6     applications from a design Model
7     Copyright (C) 2004-2005 Elapse Technologies Inc.
8
9     This library is free software; you can redistribute it and/or
10     modify it under the terms of the GNU General Public
11     License as published by the Free Software Foundation; either
12     version 2.1 of the License, or (at your option) any later version.
13
14     This library is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17     General Public License for more details.
18
19     You should have received a copy of the GNU General Public
20     License along with this library; if not, write to the Free Software
21     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */

23 package org.mdarad.framework.util.struts.action;
24
25 import java.util.Locale JavaDoc;
26
27 import javax.servlet.http.HttpServletRequest JavaDoc;
28 import javax.servlet.http.HttpServletResponse JavaDoc;
29
30 import org.apache.struts.action.ActionForm;
31
32 /**
33  * This class inherits from the <code>ActionForm</code> of the
34  * Struts Framework (http://jakarta.apache.org/struts). Amongs other
35  * things, it adds methods to get and set a <code>Locale</code> from the
36  * client browser.
37  * @author Philippe Brouillette
38  * @version 1.0
39  *
40  */

41 public abstract class MdaradActionForm extends ActionForm {
42     
43     /**
44      * Property that keeps the locale from the
45      * client app (usually a browser).
46      * The default value is the default locale
47      */

48     private Locale JavaDoc locale = Locale.getDefault();
49
50     /**
51      * Return the locale of the client
52      * @return <code>Locale</code> object of the client
53      */

54     public Locale JavaDoc getLocale() {
55         return locale;
56     }
57
58     /**
59      * Set the locale to be used
60      * @param locale <code>Locale</code> object to be used
61      * by the form.
62      */

63     public void setLocale(Locale JavaDoc locale) {
64         this.locale = locale;
65     }
66
67     /**
68      * Method that initialize the search list form.
69      * @param request
70      * @param response
71      */

72     public abstract void initialize(HttpServletRequest JavaDoc request,
73                                  HttpServletResponse JavaDoc response);
74
75 }
76
Popular Tags