/** * Must create instance through the initialize() method */ protected PrettyContext(final HttpServletRequest request) { Assert.notNull(request, "HttpServletRequest argument was null"); config = (PrettyConfig) request.getAttribute(CONFIG_KEY); if (config == null) { config = new PrettyConfig(); } contextPath = request.getContextPath(); String requestUrl = stripContextPath(request.getRequestURI()); Matcher sessionIdMatcher = JSESSIONID_PATTERN.matcher(requestUrl); if (sessionIdMatcher.matches()) { requestUrl = sessionIdMatcher.replaceFirst(JSESSIONID_REPLACEMENT); } String encoding = request.getCharacterEncoding() == null ? DEFAULT_ENCODING : request.getCharacterEncoding(); requestURL = new URL(requestUrl); requestURL.setEncoding(encoding); requestURL = requestURL.decode(); requestQuery = QueryString.build(request.getQueryString()); log.trace("Initialized PrettyContext"); }
/** * Must create instance through the initialize() method */ protected PrettyContext(final HttpServletRequest request) { Assert.notNull(request, "HttpServletRequest argument was null"); config = (PrettyConfig) request.getAttribute(CONFIG_KEY); if (config == null) { config = new PrettyConfig(); } contextPath = request.getContextPath(); String requestUrl = stripContextPath(request.getRequestURI()); Matcher sessionIdMatcher = JSESSIONID_PATTERN.matcher(requestUrl); if (sessionIdMatcher.matches()) { requestUrl = sessionIdMatcher.replaceFirst(JSESSIONID_REPLACEMENT); } String encoding = request.getCharacterEncoding() == null ? DEFAULT_ENCODING : request.getCharacterEncoding(); requestURL = new URL(requestUrl); requestURL.setEncoding(encoding); requestURL = requestURL.decode(); requestQuery = QueryString.build(request.getQueryString()); log.trace("Initialized PrettyContext"); }
/** * Must create instance through the initialize() method */ protected PrettyContext(final HttpServletRequest request) { Assert.notNull(request, "HttpServletRequest argument was null"); config = (PrettyConfig) request.getAttribute(CONFIG_KEY); if (config == null) { config = new PrettyConfig(); } contextPath = request.getContextPath(); String requestUrl = stripContextPath(request.getRequestURI()); Matcher sessionIdMatcher = JSESSIONID_PATTERN.matcher(requestUrl); if (sessionIdMatcher.matches()) { requestUrl = sessionIdMatcher.replaceFirst(JSESSIONID_REPLACEMENT); } String encoding = request.getCharacterEncoding() == null ? DEFAULT_ENCODING : request.getCharacterEncoding(); requestURL = new URL(requestUrl); requestURL.setEncoding(encoding); requestURL = requestURL.decode(); requestQuery = QueryString.build(request.getQueryString()); log.trace("Initialized PrettyContext"); }
/** * Must create instance through the initialize() method */ protected PrettyContext(final HttpServletRequest request) { Assert.notNull(request, "HttpServletRequest argument was null"); // attribute is set by PrettyFacesRewriteLifecycleListener before config = (PrettyConfig) request.getAttribute(CONFIG_KEY); // not sure if this can happen any more, but we'll keep it for now if (config == null) { config = new PrettyConfig(); } contextPath = request.getContextPath(); String requestUrl = stripContextPath(request.getRequestURI()); Matcher sessionIdMatcher = JSESSIONID_PATTERN.matcher(requestUrl); if (sessionIdMatcher.matches()) { requestUrl = sessionIdMatcher.replaceFirst(JSESSIONID_REPLACEMENT); } String encoding = request.getCharacterEncoding() == null ? DEFAULT_ENCODING : request.getCharacterEncoding(); requestURL = new URL(requestUrl); requestURL.setEncoding(encoding); requestURL = requestURL.decode(); requestQuery = QueryString.build(request.getQueryString()); log.trace("Initialized PrettyContext"); }