
org.directwebremoting.TestMethods Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dwr Show documentation
Show all versions of dwr Show documentation
DWR is easy Ajax for Java. It makes it simple to call Java code directly from Javascript.
It gets rid of almost all the boilerplate code between the web browser and your Java code.
This version 4.0.2 works with Jakarta Servlet 4.0.2.
The newest version!
package org.directwebremoting;
/**
* @author Joe Walker [joe at getahead dot ltd dot uk]
*/
public class TestMethods
{
public static void main(String[] args) {
String normalized = "http://www.test.com:8181;jsessionid=234234324?param=1";
String normalized2 = "http://www.test.com:8181;JSESSIONID=234234324?param=1";
String normalized3 = "http://www.test.com:8181?param=1;jsessionid=234234324";
String session = "jsessionid";
if(normalized.matches("(?i).*;" + session + "=.*"))
{
normalized = normalized.replaceFirst(";" + session + "=.*","");
}
System.out.println(normalized);
if(normalized2.matches("(?i).*(?i);" + session + "=.*"))
{
normalized2 = normalized2.replaceFirst("(?i);" + session + "=.*","");
}
System.out.println(normalized2);
if(normalized3.matches("(?i).*;" + session + "=.*"))
{
normalized3 = normalized3.replaceFirst("(?i);" + session + "=.*","");
}
System.out.println(normalized3);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy