Link to home
Start Free TrialLog in
Avatar of jl2001
jl2001

asked on

How to get the URL text

Hi, all

When I type (server name)/home.jsp, I need to show a popup message: This is our home. How can I get the URL text?
For example:
If URL = "(server name)/home.jsp"
  alert ("This is our home");

Thanks
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Better to just have your jsp include the js to call your alert when the window is loaded (onLoad) if the url matches.
<%
  String URL = request.getRequestURI();
%>
ASKER CERTIFIED SOLUTION
Avatar of cheekycj
cheekycj
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

"Accept cheekycj's comment as answer."
 
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Kuldeepchaturvedi
EE Cleanup Volunteer