litesoft
Diff Revisions
934
vs
935
for /trunk/DeviceDesktopTest/src/org/litesoft/servlet/LocalesFromRequest.java
|
@@ -1,20 +1,20 @@ |
1 |
1 |
|
package org.litesoft.servlet; |
2 |
2 |
|
|
3 |
|
- |
import org.litesoft.locale.AbstractLocale; |
|
3 |
+ |
import org.litesoft.locale.*; |
4 |
4 |
|
|
5 |
|
- |
import javax.servlet.http.HttpServletRequest; |
6 |
|
- |
import java.util.ArrayList; |
7 |
|
- |
import java.util.Enumeration; |
8 |
|
- |
import java.util.List; |
9 |
|
- |
import java.util.Locale; |
|
5 |
+ |
import javax.servlet.http.*; |
|
6 |
+ |
import java.util.*; |
10 |
7 |
|
|
11 |
|
- |
public class LocalesFromRequest { |
12 |
|
- |
public static List<String> getCodes(HttpServletRequest pRequest) { |
|
8 |
+ |
public class LocalesFromRequest |
|
9 |
+ |
{ |
|
10 |
+ |
public static List<String> getCodes( HttpServletRequest pRequest ) |
|
11 |
+ |
{ |
13 |
12 |
|
ArrayList<String> zCodes = new ArrayList<>(); |
14 |
13 |
|
Enumeration zLocales = pRequest.getLocales(); |
15 |
|
- |
while (zLocales.hasMoreElements()) { |
|
14 |
+ |
while ( zLocales.hasMoreElements() ) |
|
15 |
+ |
{ |
16 |
16 |
|
Locale zLocale = (Locale) zLocales.nextElement(); |
17 |
|
- |
zCodes.add(AbstractLocale.toCode(zLocale.getLanguage(), zLocale.getCountry())); |
|
17 |
+ |
zCodes.add( AbstractLocale.toCode( zLocale.getLanguage(), zLocale.getCountry() ) ); |
18 |
18 |
|
} |
19 |
19 |
|
return zCodes; |
20 |
20 |
|
} |