Sunday, December 26, 2010

JSP: Get Current URL

Simple but often asked, how do I get URL of my current JSP page ?

Here's the code :
request.getRequestURL();
where request is JSP object implementation of HttpServletRequest.

Simple, isn't it ?

No comments: