/** * Returns the original request url from the execution context. * * @return The request url of the browser document. */ public static String getRequestUrl() { return ExecutionContext.getPage().getBrowserInfo("requestURL"); }
/** * Initialize the Localizer. */ public static void init() { Localizer.setLocaleResolver(() -> { return LocaleContextHolder.getLocale(); }); Localizer.setTimeZoneResolver(() -> { TimeZone tz = null; Page page = ExecutionContext.getPage(); Integer offset = page == null ? null : page.getBrowserInfo("timezoneOffset", Integer.class); if (offset != null) { String id = "GMT" + (offset < 0 ? "-" : "+") + "%02d:%02d"; offset = Math.abs(offset); id = String.format(id, offset / 60, offset % 60); tz = TimeZone.getTimeZone(id); } return tz == null ? TimeZone.getDefault() : tz; }); }
buffer.append("\nReqURI: ").append(errReqURI); Map<String, Object> browserInfo = ExecutionContext.getPage().getBrowserInfo(); buffer.append(browserInfo);