/** * Construct. * * @param realRequest * @param url */ public FormDispatchRequest(final Request realRequest, final String url) { this.realRequest = realRequest; this.url = realRequest.decodeURL(url); String queryString = this.url.substring(this.url.indexOf("?") + 1); RequestUtils.decodeParameters(queryString, params); }
/** * Decode the provided queryString as a series of key/ value pairs and set them in the provided * value map. * * @param queryString * string to decode, uses '&' to separate parameters and '=' to separate key from * value * @param params * parameters map to write the found key/ value pairs to */ public static void decodeParameters(String queryString, PageParameters params) { decodeParameters(queryString, params, getCurrentCharset()); }
/** * Decode the provided queryString as a series of key/ value pairs and set them in the provided * value map. * * @param queryString * string to decode, uses '&' to separate parameters and '=' to separate key from * value * @param params * parameters map to write the found key/ value pairs to */ public static void decodeParameters(String queryString, PageParameters params) { decodeParameters(queryString, params, getCurrentCharset()); }
RequestUtils.decodeParameters(queryString, pageParameters); infoPath = reference.substring(0, queryStringPos);
RequestUtils.decodeParameters(queryString, pageParameters); infoPath = reference.substring(0, queryStringPos);
RequestUtils.decodeParameters(queryString, parameters);
RequestUtils.decodeParameters(queryString, pageParameters); infoPath = reference.substring(0, queryStringPos);
RequestUtils.decodeParameters(queryString, pageParameters); infoPath = reference.substring(0, queryStringPos);
/** * Initialize the request parameters from the given redirect string that redirects back to a * particular component for display. * * @param redirect * The redirect string to display from */ public void setRequestToRedirectString(final String redirect) { parameters.clear(); int queryStringPos = redirect.indexOf('?'); // Decode the parameters if (queryStringPos != -1) { final String queryString = redirect.substring(queryStringPos + 1); RequestUtils.decodeParameters(queryString, parameters); } // We need to absolutize the redirect URL as we are not as smart as a web-browser // (WICKET-702) url = getContextPath() + getServletPath() + "/" + redirect; // Remove occurrences of ".." from the path url = RequestUtils.removeDoubleDots(url); log.info("Redirecting to " + url); }
/** * Initialize the request parameters from the given redirect string that redirects back to a * particular component for display. * * @param redirect * The redirect string to display from */ public void setRequestToRedirectString(final String redirect) { parameters.clear(); int queryStringPos = redirect.indexOf('?'); // Decode the parameters if (queryStringPos != -1) { final String queryString = redirect.substring(queryStringPos + 1); RequestUtils.decodeParameters(queryString, parameters); } // We need to absolutize the redirect URL as we are not as smart as a web-browser // (WICKET-702) url = redirect; if ((url.length() == 0) || (url.charAt(0) != '/')) { url = getContextPath() + getServletPath() + "/" + redirect; } // Remove occurrences of ".." from the path url = RequestUtils.removeDoubleDots(url); log.info("Redirecting to " + url); }
/** * Creates a URL based on the given page and the given query * * @param page * the page to be used within the link * @param query * the query with all parameters * @return the url */ public static String urlWithQuery(String page, String query) { PageParameters pageParameters = new PageParameters(); if (query != null) { RequestUtils.decodeParameters(query, pageParameters); } Class<Page> resolveClass = WicketObjects.resolveClass(page); final CharSequence urlFor = RequestCycle.get().urlFor(resolveClass, pageParameters); return urlFor.toString(); }
/** * Applies the url of wicket to the tag */ @Override public int doStartTag() throws JspException { try { JspWriter out = pageContext.getOut(); PageParameters pageParameters = new PageParameters(); if (query != null) { RequestUtils.decodeParameters(query, pageParameters); } Class<Page> resolveClass = WicketObjects.resolveClass(page); CharSequence urlFor = RequestCycle.get().urlFor(resolveClass, pageParameters); out.write(urlFor.toString()); out.flush(); } catch (IOException e) { LOGGER.error("Error while generating url for page " + page, e); throw new JspException("Error while generating url for page ", e); } return SKIP_BODY; }
RequestUtils.decodeParameters(decodedParamReplacement, params); parameterMap.putAll(params);
RequestUtils.decodeParameters(decodedParamReplacement, params); parameterMap.putAll(params);
if (query != null) RequestUtils.decodeParameters(query, pageParameters);
/** * Gets the plan callback URL to process a request to the current rendered page with pre * rendered query arguments * * @param query * the query * @return the plane callback URL */ public static String ajaxCallbackUrlWithQuery(String query) { PageParameters pageParameters = new PageParameters(); if (query != null) { RequestUtils.decodeParameters(query, pageParameters); } pageParameters.add("pageId", PageRequestHandlerTracker.getLastHandler(RequestCycle.get()) .getPage().getPageId()); final CharSequence urlFor = RequestCycle.get().urlFor(new JEEWebGlobalAjaxHandler(), pageParameters); return urlFor.toString(); }