url: http://localhost:8080/img/crew/cover.jsp?p=a
request.getServerName() – localhost
request.getServerPort() – 8080
request.getServletPath() – /crew/cover.jsp
request.getRequestURI() – /img/crew/cover.jsp
request.getRequestURL() – http://localhost:8080/img/crew/cover.jsp
request.getQueryString() – p=a
steve said
thanks i found this handy. much appreciated.
Ian in VT said
This was a very helpful page. Thanks!
Jasmine said
Thanks!!
tis very helpful
removeps-generic@yahoo.com said
How do you get the difference between the URL and URI? That is, how to get the
http://localhost:8080
longlog said
use string’s substring function
Silpa said
I refered some searches that google gave me,but the last but not the least and best one among them is this page for my search.
I am gratefull to the author.
Yasir Ashfaq said
Thanks, it very very helpfull.
stephen said
helpful, thanks