As @fabricated belief said, you can use window.location to get the address bar (client-side method) on the web page.
To obtain the address bar from the server side, use request.getRequestURL(), and the content after ? needs to be obtained from request.getQueryString(), and the content after # cannot be obtained.
The address bar can only be obtained in JavaScript scripts, using window.location. Reference documentation:
https://developer.mozilla.org...
As @fabricated belief said, you can use window.location to get the address bar (client-side method) on the web page.
To obtain the address bar from the server side, use
request.getRequestURL()
, and the content after?
needs to be obtained fromrequest.getQueryString()
, and the content after#
cannot be obtained.