Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web browser url retrieval 2

Status
Not open for further replies.

sparc20

Programmer
Joined
Mar 13, 2002
Messages
56
Location
GB
I want to retrieve the URL of the web-browser to use within a .jsp page.

Anyone knows how to do that ?
 
Hi,

You can use request.getRequestURL() to get the URL
and request.getRequestURI() to get the URI.

Cheers,
Venu
 
String url = "String[] t = url.split("//");
String nonProtocolAddress = t[1];

or,

String url = "StringTokenizer st = new StringTokenizer(url, "/");
st.nextToken();
String nonProtocolAddress = st.nextToken();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top