KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dinamica > SetLanguage


1 package dinamica;
2
3 import java.util.Locale JavaDoc;
4 import dinamica.GenericTransaction;
5 import dinamica.Recordset;
6
7 /**
8  * Receives a request parameter that MUST be named "locale"
9  * and set a session attribute named "dinamica.user.locale"
10  * containing a Locale object initialized with the language
11  * code (en, es, it, etc). This can be used to change the language in interactive mode.
12  * <br><br>
13  * Creation date: 10/05/2005
14  * (c) 2005 Martin Cordova<br>
15  * This code is released under the LGPL license<br>
16  * Dinamica Framework - http://www.martincordova.com<br>
17  * @author Martin Cordova (dinamica@martincordova.com)
18  */

19 public class SetLanguage extends GenericTransaction
20 {
21
22     public int service(Recordset inputParams) throws Throwable JavaDoc
23     {
24         
25         Locale JavaDoc l = new Locale JavaDoc(inputParams.getString("locale"));
26         getSession().setAttribute("dinamica.user.locale", l);
27         super.service(inputParams);
28         return 0;
29         
30     }
31 }
32
Popular Tags