I was trying to use the string replace with another, it doesn't happen.
String requestURI = "/webapps-ab/public/Test.jsp"
String contextName = "webapps-ab";
String newRequestURI = requestURI.replaceFirst(contextName,"webapps");
I am expecting newRequestURI to be "/webapps/public/Test.jsp".