Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1026 → Rev 1085

/backpath/trunk/src/ak/backpath/BackPath.java
38,6 → 38,8
public static final char URL_PARAM_SEPARATOR = '&';
public static final char URL_PARAM_VALUE = '=';
public static final char URL_PARAM_VALUE_SEP = ',';
public static final String REQUEST_URI_ATTR = "javax.servlet.forward.request_uri";
public static final String REQUEST_PARAMS_ATTR = "javax.servlet.forward.query_string";
 
protected static final byte URL_DELIMITER = 0;
protected static final int BUFFER_SIZE = 1024;
305,6 → 307,38
decode(stack, request.getParameter(param), zip);
 
// add new
String url = getOriginalURL(request);
if(url == null) url = getCurentURL(request);
stack.add(url);
}
catch(IOException ex) {
log.error("Cannot init", ex);
}
}
 
/**
* If internal servlet forward is used try to find the original URL of client request
*
*/
protected String getOriginalURL(HttpServletRequest request)
{
String url = (String)request.getAttribute(REQUEST_URI_ATTR);
if(url == null) return null;
 
String params = (String)request.getAttribute(REQUEST_PARAMS_ATTR);
if(params != null)
url += URL_PARAM_START + params;
 
return url;
}
 
/**
* Get URL of client request if no internal servlet forward detected
*
*/
protected String getCurentURL(HttpServletRequest request)
throws IOException
{
String url = (new URL(request.getRequestURL().toString())).getPath();
if(methodsToSaveParams.contains(request.getMethod())) {
// to ignore
339,12 → 373,8
if(query.length() > 0) url = query.insert(0, url).toString();
}
 
stack.add(url);
return url;
}
catch(IOException ex) {
log.error("Cannot init", ex);
}
}
 
/**
* @param stack List(String)