private String getRequestURL(HttpServletRequest request)throws Exception
{
if (request == null) {
throw new Exception();
}
String url = request.getRequestURL().toString() + "?";
Enumeration<?> em = request.getParameterNames();
String tempName = "";
StringBuffer sb = new StringBuffer(url);
while (em.hasMoreElements()) {
tempName = (String)em.nextElement();
sb.append(tempName);
sb.append('=');
sb.append(request.getParameter(tempName));
sb.append('&');
}
url = sb.toString();
if (url.endsWith("&"))
url = url.substring(0, url.length() - 1);
if (url.endsWith("?")) {
url = url.substring(0, url.length() - 1);
}
return url;
}
{
if (request == null) {
throw new Exception();
}
String url = request.getRequestURL().toString() + "?";
Enumeration<?> em = request.getParameterNames();
String tempName = "";
StringBuffer sb = new StringBuffer(url);
while (em.hasMoreElements()) {
tempName = (String)em.nextElement();
sb.append(tempName);
sb.append('=');
sb.append(request.getParameter(tempName));
sb.append('&');
}
url = sb.toString();
if (url.endsWith("&"))
url = url.substring(0, url.length() - 1);
if (url.endsWith("?")) {
url = url.substring(0, url.length() - 1);
}
return url;
}