38,8 → 38,6 |
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; |
307,38 → 305,6 |
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 |
373,8 → 339,12 |
if(query.length() > 0) url = query.insert(0, url).toString(); |
} |
|
return url; |
stack.add(url); |
} |
catch(IOException ex) { |
log.error("Cannot init", ex); |
} |
} |
|
/** |
* @param stack List(String) |