public static final String getCompleteContext(HttpServletRequest hreq) {
final StringBuffer sb = hreq.getRequestURL();
final String ctx = hreq.getContextPath();
final int j = sb.indexOf(ctx);
if (j < 0)
throw new SystemException("Unknown request: url="+sb+", ctx="+ctx);
return sb.delete(j + ctx.length(), sb.length()).toString();
}