The following code fragment will return the entire URL of the current Servlet
String currentFile = request.getRequestURI();
if (request.getQueryString() != null)
{
currentFile = currentFile + '?' + request.getQueryString();
}
URL currentURL = new URL(request.getScheme(),
request.getServerName(), request.getServerPort(), currentFile);
out.println(URL.toString());
Subscribe to:
Post Comments (Atom)
hi valan....keep up this good work
ReplyDelete