* @param request The request.
*/
protected void setHistory(Request request) {
Session session = request.getSession(true);
Stack history = (Stack) session.getAttribute(HISTORY);
if (history == null) {
history = new Stack(10);
session.setAttribute(HISTORY, history);
}
String url = request.getRequestURI();
String context = request.getContextPath();
if (context == null) {
context = "";
}
url = url.substring(context.length());
history.push(url);
}