rohith
rohith

Reputation: 11

to get URL address

how to get URL address while every time page is refreshed in java..? i'm doing projects which requires URL(domain name ) while every ti e page is refreshed..!!

Upvotes: 1

Views: 2280

Answers (1)

Pranay Rana
Pranay Rana

Reputation: 176896

user request object to obtain url

// Getting servlet request URL

String url = request.getRequestURL().toString();

// Getting servlet request query string.

String queryString = request.getQueryString();



// Getting request information without the hostname.

String uri = request.getRequestURI();

Upvotes: 1

Related Questions