@Test public void testRewrite2() { Assert.assertEquals("?personId=1&value=2", RequestWrapper .updateQueryString("?personId=1-88B-DBEDAFDE-10-0-BEB37C78B859D3212B19066A8E2FACB0&value=2", null, "personId", "1")); }
static String updateQueryString(final String queryString, final String modifiedQueryString, final String name, final String value) { if (queryString != null) { int start = queryString.indexOf(name + "="); if (start != -1) { start += name.length() + 1; int end = queryString.indexOf('&', start); if (end == -1) { end = queryString.length(); } return queryString.substring(0, start) + value + queryString.substring(end); } } return modifiedQueryString; }
RequestWrapper extends HttpServletRequestWrapper { static String updateQueryString(final String queryString, final String modifiedQueryString, final String name, final String value) { if (queryString != null) { int start = queryString.indexOf(name + "="); if (start != -1) { start += name.length() + 1; int end = queryString.indexOf('&', start); if (end == -1) { end = queryString.length(); } return queryString.substring(0, start) + value + queryString.substring(end); } } return modifiedQueryString; } }
RequestWrapper extends HttpServletRequestWrapper { static String updateQueryString(final String queryString, final String modifiedQueryString, final String name, final String value) { if (queryString != null) { int start = queryString.indexOf(name + "="); if (start != -1) { start += name.length() + 1; int end = queryString.indexOf('&', start); if (end == -1) { end = queryString.length(); } return queryString.substring(0, start) + value + queryString.substring(end); } } return modifiedQueryString; } @SuppressWarnings("deprecation")  RequestWrapper(final RequestContextHolder requestContext); }
RequestWrapper extends HttpServletRequestWrapper { static String updateQueryString(final String queryString, final String modifiedQueryString, final String name, final String value) { if (queryString != null) { int start = queryString.indexOf(name + "="); if (start != -1) { start += name.length() + 1; int end = queryString.indexOf('&', start); if (end == -1) { end = queryString.length(); } return queryString.substring(0, start) + value + queryString.substring(end); } } return modifiedQueryString; } @SuppressWarnings("deprecation")  RequestWrapper(final RequestContextHolder requestContext); @Override String[] getParameterValues(final String parameter); @Override String getParameter(final String parameter); @Override Enumeration<String> getParameterNames(); @Override @SuppressWarnings("unchecked") String getHeader(final String name); @Override @SuppressWarnings("unchecked") Enumeration<String> getHeaders(final String name); void addParameter(final String name, final String[] value); @Override String getQueryString(); @Override Map<String, String[]> getParameterMap(); @Override @SuppressWarnings("deprecation") void setAttribute(final String name, final Object o); @Override @SuppressWarnings("deprecation") void removeAttribute(final String name); Map<String, Object> getTextElements(); Map<String, Object> getFileElements(); void addTextParameter(final String name, final Object value); void addFileItem(final String name, final Object values); void addEditableParameter(final String parameter); boolean isEditableParameter(final String parameter); void setMultipart(final boolean isMultipart); void setCookiesConfidentiality(final boolean cookiesConfidentiality); void setConfidentiality(final boolean confidentiality); void setSession(final ISession session); static void setRewriteURI(final boolean rewriteURI); }
RequestWrapper extends HttpServletRequestWrapper { static String updateQueryString(final String queryString, final String modifiedQueryString, final String name, final String value) { if (queryString != null) { int start = queryString.indexOf(name + "="); if (start != -1) { start += name.length() + 1; int end = queryString.indexOf('&', start); if (end == -1) { end = queryString.length(); } return queryString.substring(0, start) + value + queryString.substring(end); } } return modifiedQueryString; } @SuppressWarnings("deprecation")  RequestWrapper(final RequestContextHolder requestContext); @Override String[] getParameterValues(final String parameter); @Override String getParameter(final String parameter); @Override Enumeration<String> getParameterNames(); @Override @SuppressWarnings("unchecked") String getHeader(final String name); @Override @SuppressWarnings("unchecked") Enumeration<String> getHeaders(final String name); void addParameter(final String name, final String[] value); @Override String getQueryString(); @Override Map<String, String[]> getParameterMap(); @Override @SuppressWarnings("deprecation") void setAttribute(final String name, final Object o); @Override @SuppressWarnings("deprecation") void removeAttribute(final String name); Map<String, Object> getTextElements(); Map<String, Object> getFileElements(); void addTextParameter(final String name, final Object value); void addFileItem(final String name, final Object values); void addEditableParameter(final String parameter); boolean isEditableParameter(final String parameter); void setMultipart(final boolean isMultipart); void setCookiesConfidentiality(final boolean cookiesConfidentiality); void setConfidentiality(final boolean confidentiality); void setSession(final ISession session); static void setRewriteURI(final boolean rewriteURI);  }