@Test public void testProcessActionJsessionIdParam() { final String url = "/testAction.do;jsessionid=67CFB560B6EC2677D51814A2A2B16B24?params=1"; final UrlDataImpl data = new UrlDataImpl(url, Method.GET); Assert.assertEquals("/testAction.do?params=1", HDIVUtil.stripAndFillSessionData(url, data)); Assert.assertEquals("jsessionid=67CFB560B6EC2677D51814A2A2B16B24", data.getjSessionId()); }
public static String stripAndFillSessionData(final String url, final UrlDataImpl urldata) { final int pos = url.indexOf(';'); if (pos != -1) { final char[] data = url.toCharArray(); int sessionStart; if ((sessionStart = indexOf(data, jsessionLower, pos)) != -1 || (sessionStart = indexOf(data, jsessionUpper, pos)) != -1) { int sessionEnd = indexOf(data, SEMICOLON, sessionStart + 1); if (sessionEnd == -1) { sessionEnd = indexOf(data, QUESTION, sessionStart + 1); } if (sessionEnd == -1) { sessionEnd = data.length; } final int len = sessionEnd - sessionStart; if (len > 0) { if (urldata != null) { urldata.setjSessionId(new String(data, sessionStart + 1, len - 1)); } System.arraycopy(data, sessionStart + len, data, sessionStart, data.length - sessionEnd); return new String(data, 0, data.length - len); } } } return url; }
HDIVUtil { public static String stripAndFillSessionData(final String url, final UrlDataImpl urldata) { final int pos = url.indexOf(';'); if (pos != -1) { final char[] data = url.toCharArray(); int sessionStart; if ((sessionStart = indexOf(data, jsessionLower, pos)) != -1 || (sessionStart = indexOf(data, jsessionUpper, pos)) != -1) { int sessionEnd = indexOf(data, SEMICOLON, sessionStart + 1); if (sessionEnd == -1) { sessionEnd = indexOf(data, QUESTION, sessionStart + 1); } if (sessionEnd == -1) { sessionEnd = data.length; } final int len = sessionEnd - sessionStart; if (len > 0) { if (urldata != null) { urldata.setjSessionId(new String(data, sessionStart + 1, len - 1)); } System.arraycopy(data, sessionStart + len, data, sessionStart, data.length - sessionEnd); return new String(data, 0, data.length - len); } } } return url; } }
HDIVUtil { public static String stripAndFillSessionData(final String url, final UrlDataImpl urldata) { final int pos = url.indexOf(';'); if (pos != -1) { final char[] data = url.toCharArray(); int sessionStart; if ((sessionStart = indexOf(data, jsessionLower, pos)) != -1 || (sessionStart = indexOf(data, jsessionUpper, pos)) != -1) { int sessionEnd = indexOf(data, SEMICOLON, sessionStart + 1); if (sessionEnd == -1) { sessionEnd = indexOf(data, QUESTION, sessionStart + 1); } if (sessionEnd == -1) { sessionEnd = data.length; } final int len = sessionEnd - sessionStart; if (len > 0) { if (urldata != null) { urldata.setjSessionId(new String(data, sessionStart + 1, len - 1)); } System.arraycopy(data, sessionStart + len, data, sessionStart, data.length - sessionEnd); return new String(data, 0, data.length - len); } } } return url; } private  HDIVUtil(); }
HDIVUtil { public static String stripAndFillSessionData(final String url, final UrlDataImpl urldata) { final int pos = url.indexOf(';'); if (pos != -1) { final char[] data = url.toCharArray(); int sessionStart; if ((sessionStart = indexOf(data, jsessionLower, pos)) != -1 || (sessionStart = indexOf(data, jsessionUpper, pos)) != -1) { int sessionEnd = indexOf(data, SEMICOLON, sessionStart + 1); if (sessionEnd == -1) { sessionEnd = indexOf(data, QUESTION, sessionStart + 1); } if (sessionEnd == -1) { sessionEnd = data.length; } final int len = sessionEnd - sessionStart; if (len > 0) { if (urldata != null) { urldata.setjSessionId(new String(data, sessionStart + 1, len - 1)); } System.arraycopy(data, sessionStart + len, data, sessionStart, data.length - sessionEnd); return new String(data, 0, data.length - len); } } } return url; } private  HDIVUtil(); static boolean isServlet3(); static IApplication getApplication(final ServletContext servletContext); static void setApplication(final IApplication newApplication, final ServletContext servletContext); static HDIVConfig getHDIVConfig(final ServletContext servletContext); static void setHDIVConfig(final HDIVConfig hdivConfig, final ServletContext servletContext); static LinkUrlProcessor getLinkUrlProcessor(final ServletContext servletContext); static void setLinkUrlProcessor(final LinkUrlProcessor urlProcessor, final ServletContext servletContext); static FormUrlProcessor getFormUrlProcessor(final ServletContext servletContext); static void setFormUrlProcessor(final FormUrlProcessor urlProcessor, final ServletContext servletContext); static MessageSource getMessageSource(final HttpServletRequest request); static MessageSource getMessageSource(final ServletContext servletContext); static void setMessageSource(final MessageSource msgSource, final ServletContext servletContext); static String getMessage(final HttpServletRequest request, final String key); static String getMessage(final HttpServletRequest request, final String key, final String o); static String getMessage(final HttpServletRequest request, final String key, final String o, final Locale userLocale); @SuppressWarnings("deprecation") static RequestContextHolder getRequestContext(final ServletRequest request); static HttpServletRequest getCurrentHttpRequest(); @Deprecated static String getHdivState(final HttpServletRequest request); @Deprecated static void setHdivState(final HttpServletRequest request, final String value); static boolean isObfuscatedTarget(final String target); static String createRandomToken(final int n); static String stripSession(final String url); static String stripAndFillSessionData(final String url, final UrlDataImpl urldata); @SuppressWarnings("unchecked") static T getNativeRequest(final ServletRequest request, final Class<T> requiredType); static ApplicationContext findWebApplicationContext(final ServletContext sc); static void registerApplicationContext(final ApplicationContext context, final ServletContext scontext); static String getDecodedValue(final StringBuilder sb, final String value, final String charEncoding); static boolean isTheSameEncodedValue(final String parameterValue, final String value); static String decodeValue(final StringBuilder sb, final String s, final String enc); static boolean isPathVariable(final String uriTemplate, final String variable); static boolean isMultipartContent(final HttpServletRequest request); @Deprecated static String getRequestURI(final HttpServletRequest request); @Deprecated static void setRequestURI(final String requestURI, final HttpServletRequest request); @Deprecated static Integer getCurrentPageId(final ServletRequest request); @Deprecated static void setCurrentPageId(final Integer pageId, final ServletRequest request); @Deprecated static String getModifyHdivStateParameterName(final HttpServletRequest request); @Deprecated static void setModifyHdivStateParameterName(final HttpServletRequest request, final String parameterName); @Deprecated static String getHdivStateParameterName(final HttpServletRequest request); @Deprecated static void setHdivStateParameterName(final HttpServletRequest request, final String parameterName); @Deprecated static String getBaseURL(final ServletRequest request); @Deprecated static void setBaseURL(final String baseURL, final ServletRequest request); @Deprecated static IDataComposer getDataComposer(final ServletRequest request); @Deprecated static void setDataComposer(final IDataComposer newDataComposer, final HttpServletRequest request); @Deprecated static void removeDataComposer(final HttpServletRequest request); static String replaceOnce(final String text, final String searchString, final String replacement); static String replace(final String text, String searchString, final String replacement, int max, final boolean ignoreCase); @SuppressWarnings({ "deprecation" }) static String getCustomImage(final HttpServletRequest request); static boolean checkCustomImage(final HttpServletRequest request); static boolean isButtonType(final String type); static boolean isNonConfidentialType(final String type); static List<T> findBeansInWebApplicationContext(final Class<T> beanType); static List<WebApplicationContext> findWebApplicationContextWithBeans(final Class<?> beanType); }
HDIVUtil { public static String stripAndFillSessionData(final String url, final UrlDataImpl urldata) { final int pos = url.indexOf(';'); if (pos != -1) { final char[] data = url.toCharArray(); int sessionStart; if ((sessionStart = indexOf(data, jsessionLower, pos)) != -1 || (sessionStart = indexOf(data, jsessionUpper, pos)) != -1) { int sessionEnd = indexOf(data, SEMICOLON, sessionStart + 1); if (sessionEnd == -1) { sessionEnd = indexOf(data, QUESTION, sessionStart + 1); } if (sessionEnd == -1) { sessionEnd = data.length; } final int len = sessionEnd - sessionStart; if (len > 0) { if (urldata != null) { urldata.setjSessionId(new String(data, sessionStart + 1, len - 1)); } System.arraycopy(data, sessionStart + len, data, sessionStart, data.length - sessionEnd); return new String(data, 0, data.length - len); } } } return url; } private  HDIVUtil(); static boolean isServlet3(); static IApplication getApplication(final ServletContext servletContext); static void setApplication(final IApplication newApplication, final ServletContext servletContext); static HDIVConfig getHDIVConfig(final ServletContext servletContext); static void setHDIVConfig(final HDIVConfig hdivConfig, final ServletContext servletContext); static LinkUrlProcessor getLinkUrlProcessor(final ServletContext servletContext); static void setLinkUrlProcessor(final LinkUrlProcessor urlProcessor, final ServletContext servletContext); static FormUrlProcessor getFormUrlProcessor(final ServletContext servletContext); static void setFormUrlProcessor(final FormUrlProcessor urlProcessor, final ServletContext servletContext); static MessageSource getMessageSource(final HttpServletRequest request); static MessageSource getMessageSource(final ServletContext servletContext); static void setMessageSource(final MessageSource msgSource, final ServletContext servletContext); static String getMessage(final HttpServletRequest request, final String key); static String getMessage(final HttpServletRequest request, final String key, final String o); static String getMessage(final HttpServletRequest request, final String key, final String o, final Locale userLocale); @SuppressWarnings("deprecation") static RequestContextHolder getRequestContext(final ServletRequest request); static HttpServletRequest getCurrentHttpRequest(); @Deprecated static String getHdivState(final HttpServletRequest request); @Deprecated static void setHdivState(final HttpServletRequest request, final String value); static boolean isObfuscatedTarget(final String target); static String createRandomToken(final int n); static String stripSession(final String url); static String stripAndFillSessionData(final String url, final UrlDataImpl urldata); @SuppressWarnings("unchecked") static T getNativeRequest(final ServletRequest request, final Class<T> requiredType); static ApplicationContext findWebApplicationContext(final ServletContext sc); static void registerApplicationContext(final ApplicationContext context, final ServletContext scontext); static String getDecodedValue(final StringBuilder sb, final String value, final String charEncoding); static boolean isTheSameEncodedValue(final String parameterValue, final String value); static String decodeValue(final StringBuilder sb, final String s, final String enc); static boolean isPathVariable(final String uriTemplate, final String variable); static boolean isMultipartContent(final HttpServletRequest request); @Deprecated static String getRequestURI(final HttpServletRequest request); @Deprecated static void setRequestURI(final String requestURI, final HttpServletRequest request); @Deprecated static Integer getCurrentPageId(final ServletRequest request); @Deprecated static void setCurrentPageId(final Integer pageId, final ServletRequest request); @Deprecated static String getModifyHdivStateParameterName(final HttpServletRequest request); @Deprecated static void setModifyHdivStateParameterName(final HttpServletRequest request, final String parameterName); @Deprecated static String getHdivStateParameterName(final HttpServletRequest request); @Deprecated static void setHdivStateParameterName(final HttpServletRequest request, final String parameterName); @Deprecated static String getBaseURL(final ServletRequest request); @Deprecated static void setBaseURL(final String baseURL, final ServletRequest request); @Deprecated static IDataComposer getDataComposer(final ServletRequest request); @Deprecated static void setDataComposer(final IDataComposer newDataComposer, final HttpServletRequest request); @Deprecated static void removeDataComposer(final HttpServletRequest request); static String replaceOnce(final String text, final String searchString, final String replacement); static String replace(final String text, String searchString, final String replacement, int max, final boolean ignoreCase); @SuppressWarnings({ "deprecation" }) static String getCustomImage(final HttpServletRequest request); static boolean checkCustomImage(final HttpServletRequest request); static boolean isButtonType(final String type); static boolean isNonConfidentialType(final String type); static List<T> findBeansInWebApplicationContext(final Class<T> beanType); static List<WebApplicationContext> findWebApplicationContextWithBeans(final Class<?> beanType); static final Pattern intPattern; }