rekonq sends some strange language feel which cannot be parsed by Jersey. It is 'Bad Accept-Language field: cs,en-US;q=0.9,en;q=0.8, cz, en_US'
1.1 --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Tue Sep 14 09:46:43 2010 +0200
1.2 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sat Oct 23 22:51:43 2010 +0200
1.3 @@ -32,6 +32,7 @@
1.4 import java.io.StringWriter;
1.5 import java.net.URI;
1.6 import java.text.MessageFormat;
1.7 +import java.text.ParseException;
1.8 import java.util.ArrayList;
1.9 import java.util.Arrays;
1.10 import java.util.Date;
1.11 @@ -51,6 +52,7 @@
1.12 import javax.ws.rs.PathParam;
1.13 import javax.ws.rs.Produces;
1.14 import javax.ws.rs.QueryParam;
1.15 +import javax.ws.rs.WebApplicationException;
1.16 import javax.ws.rs.core.CacheControl;
1.17 import javax.ws.rs.core.Context;
1.18 import javax.ws.rs.core.Cookie;
1.19 @@ -558,16 +560,20 @@
1.20 }
1.21 }
1.22 if (rb == null) {
1.23 - for (Locale l : headers.getAcceptableLanguages()) {
1.24 - try {
1.25 - rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI.Bundle", l);
1.26 - if (locale != null) {
1.27 - locale[0] = l;
1.28 + try {
1.29 + for (Locale l : headers.getAcceptableLanguages()) {
1.30 + try {
1.31 + rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI.Bundle", l);
1.32 + if (locale != null) {
1.33 + locale[0] = l;
1.34 + }
1.35 + break;
1.36 + } catch (MissingResourceException e) {
1.37 + // OK
1.38 }
1.39 - break;
1.40 - } catch (MissingResourceException e) {
1.41 - // OK
1.42 }
1.43 + } catch (WebApplicationException ex) {
1.44 + // OK, can't parse header
1.45 }
1.46 }
1.47 if (rb == null) {
2.1 --- a/pom.xml Tue Sep 14 09:46:43 2010 +0200
2.2 +++ b/pom.xml Sat Oct 23 22:51:43 2010 +0200
2.3 @@ -50,7 +50,7 @@
2.4 <quoridorVersion>1.4</quoridorVersion>
2.5 <webidorVersion>1.17</webidorVersion>
2.6 <visidorVersion>1.0-SNAPSHOT</visidorVersion>
2.7 - <freemarkerVersion>1.60</freemarkerVersion>
2.8 + <freemarkerVersion>1.61</freemarkerVersion>
2.9 <emailerVersion>1.1</emailerVersion>
2.10 <statisticsVersion>1.8</statisticsVersion>
2.11 <wsdorVersion>1.0</wsdorVersion>