- try {
- Class reqClass = request.getClass();
- Method method = reqClass.getMethod("setCharacterEncoding", new Class[]{String.class});
- String encoding = configuration.getString("Mir.DefaultHTMLCharset");
- method.invoke(request, new Object[]{encoding});
- } catch (NoSuchMethodException e) {
- // TODO set the encoding in a zapata-way
- e.printStackTrace();
- logger.error("not yes implemented: " + e.getMessage());
- } catch (SecurityException e) {
- logger.error(e.getMessage());
- e.printStackTrace();
- } catch (IllegalArgumentException e) {
- logger.error(e.getMessage());
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- logger.error(e.getMessage());
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- logger.error(e.getMessage());
- e.printStackTrace();
- }
+ try {
+ logger.info("Request has encoding: " + request.getCharacterEncoding());
+ logger.info("Config stipulates encoding: " + configuration.getString("Mir.DefaultHTMLCharset"));
+ Class reqClass = request.getClass();
+ Method method = reqClass.getMethod("setCharacterEncoding", new Class[]{String.class});
+ String encoding = configuration.getString("Mir.DefaultHTMLCharset");
+ method.invoke(request, new Object[]{encoding});
+ logger.info("Request now has encoding: " + request.getCharacterEncoding());
+ }
+ catch (NoSuchMethodException e) {
+ // TODO set the encoding in a zapata-way
+// logger.warn("set encoding not yet implemented: " + e.getMessage());
+ }
+ catch (SecurityException e) {
+ logger.error(e.getMessage());
+ e.printStackTrace();
+ }
+ catch (IllegalArgumentException e) {
+ logger.error(e.getMessage());
+ e.printStackTrace();
+ }
+ catch (IllegalAccessException e) {
+ logger.error(e.getMessage());
+ e.printStackTrace();
+ }
+ catch (InvocationTargetException e) {
+ logger.error(e.getMessage());
+ e.printStackTrace();
+ }