Feb 28, 2004 #1 sparc20 Programmer Mar 13, 2002 56 GB I want to retrieve the URL of the web-browser to use within a .jsp page. Anyone knows how to do that ?
I want to retrieve the URL of the web-browser to use within a .jsp page. Anyone knows how to do that ?
Feb 28, 2004 1 #2 venur MIS Aug 26, 2003 418 US Hi, You can use request.getRequestURL() to get the URL and request.getRequestURI() to get the URI. Cheers, Venu Upvote 0 Downvote
Hi, You can use request.getRequestURL() to get the URL and request.getRequestURI() to get the URI. Cheers, Venu
Feb 28, 2004 Thread starter #3 sparc20 Programmer Mar 13, 2002 56 GB is there any way of retrieving the URL without the protocol i.e. http://www.google.com instead of http://www.google.com ??? Upvote 0 Downvote
is there any way of retrieving the URL without the protocol i.e. http://www.google.com instead of http://www.google.com ???
Feb 28, 2004 1 #4 sedj Programmer Aug 6, 2002 5,610 String url = "http://www.google.com";String[] t = url.split("//"); String nonProtocolAddress = t[1]; or, String url = "http://www.google.com";StringTokenizer st = new StringTokenizer(url, "/"); st.nextToken(); String nonProtocolAddress = st.nextToken(); Upvote 0 Downvote
String url = "http://www.google.com";String[] t = url.split("//"); String nonProtocolAddress = t[1]; or, String url = "http://www.google.com";StringTokenizer st = new StringTokenizer(url, "/"); st.nextToken(); String nonProtocolAddress = st.nextToken();