private String plainReplacement ( String pUrl , String pServletPath ) { int idx = pUrl . lastIndexOf ( pServletPath ) ; String url ; if ( idx != - 1 ) { url = pUrl . substring ( 0 , idx ) + pServletPath ; } else { url = pUrl ; } return url ; }
Fallback used if URL creation didnt work