public PrettyConfig getConfig() { if ((servletContext == null) || (servletContext.getAttribute(PrettyContext.CONFIG_KEY) == null)) { log.warn("PrettyFilter is not registered in web.xml, but is registered with JSF " + "Navigation and Action handlers -- this could cause unpredictable behavior."); return new PrettyConfig(); } return (PrettyConfig) servletContext.getAttribute(PrettyContext.CONFIG_KEY); }
public PrettyConfig getConfig() { if ((servletContext == null) || (servletContext.getAttribute(PrettyContext.CONFIG_KEY) == null)) { log.warn("PrettyFilter is not registered in web.xml, but is registered with JSF " + "Navigation and Action handlers -- this could cause unpredictable behavior."); return new PrettyConfig(); } return (PrettyConfig) servletContext.getAttribute(PrettyContext.CONFIG_KEY); }
public PrettyConfig getConfig() { if ((servletContext == null) || (servletContext.getAttribute(PrettyContext.CONFIG_KEY) == null)) { log.warn("PrettyFilter is not registered in web.xml, but is registered with JSF " + "Navigation and Action handlers -- this could cause unpredictable behavior."); return new PrettyConfig(); } return (PrettyConfig) servletContext.getAttribute(PrettyContext.CONFIG_KEY); }
public PrettyConfig build() { final PrettyConfig config = new PrettyConfig(); config.setMappings(mappings); config.setGlobalRewriteRules(rewriteRules); return config; } }
public PrettyConfig build() { final PrettyConfig config = new PrettyConfig(); config.setMappings(mappings); config.setGlobalRewriteRules(rewriteRules); return config; } }
public PrettyConfig build() { final PrettyConfig config = new PrettyConfig(); config.setMappings(mappings); config.setGlobalRewriteRules(rewriteRules); return config; } }
public PrettyConfig build() { final PrettyConfig config = new PrettyConfig(); config.setMappings(mappings); config.setGlobalRewriteRules(rewriteRules); return config; } }
/** * 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"); }
@Override public PrettyConfig loadConfiguration(ServletContext sc) { WebXmlParser webXmlParser = new WebXmlParser(); try { webXmlParser.parse(sc); } catch (IOException ex) { throw new RuntimeException(ex); } catch (SAXException ex) { throw new RuntimeException(ex); } BeanManager beanManager = (BeanManager) sc.getAttribute(BeanManagerServletContextListener.BEANMANAGER_SERVLETCONTEXT_KEY); ViewConfigStore store = BeanManagerUtils.getContextualInstance(beanManager, ViewConfigStore.class); List<UrlMapping> mappings = loadUrlMappings(store, webXmlParser.getFacesMapping()); PrettyConfig prettyConfig = new PrettyConfig(); prettyConfig.setMappings(mappings); return prettyConfig; }