//String requestHandlerPath = _servletRequest.getPathInfo();
String requestHandlerPath = urlString;
if (requestHandlerPath != null) {
int requestHandlerPathLength = requestHandlerPath.length();
if (requestHandlerPathLength > 0) {
StringArray pathComponents = AWUtil.componentsSeparatedByString(requestHandlerPath, "/");
// Note: first entry is always empty string since requestHandlerPath starts with "/".
int pathComponentCount = pathComponents.inUse();
int servletUrlPrefixComponentCount = ((AWServletApplication)AWConcreteApplication.SharedInstance).servletUrlPrefixComponentCount();
int currentFieldIndex = servletUrlPrefixComponentCount + 1;
if (requestHandlerPath.startsWith("/")) {
currentFieldIndex ++;
}
// aling: I don't not fully understand why for catalog login URL currentFieldIndex
// could equal to array lenth, for buyer logic url it equals length - 1, which is correct
if (pathComponentCount > currentFieldIndex) {
String[] pathComponentsArray = pathComponents.array();
String firstField = pathComponentsArray[currentFieldIndex];
// Note: when user types trailing "/" in their URL,
// say http://y:8001/Ariba/Buyer/, here we got "", so this if branch
// is to solve the trailing "/" problem
// Defect 81707 and 79077