What I want to do is print the route of the host that I am currently on.
First code
Javascript code
var urlObt;
urlObt = window.location.href;
JSP Code
String url = "<script>document.write(urlObt)</script>";
Impression in href
Form 1
<link rel="stylesheet" href="<%=url%>/CSS/index.css">
Form 2
<link rel="stylesheet" href="<%=out.println(url)%>/CSS/index.css">
Result:
http://localhost:8080/GIBLO/%3Cscript%3Edocument.write(urlObt)%3C/script%3E/CSS/index.css
Also try directly from the JSP
out.println(request.getAttribute("javax.servlet.forward.request_uri"));
But I came out null