How would I get the full URL of a JSP page.
For example the URL might be http://www.example.com/news.do/?language=nl&country=NL
If I do things like the following I always get news.jsp and not .do
out.print(request.getServletPath());
out.print(request.getRequestURI());
out.print(request.getRequest());
out.print(request.getContextPath());
You need to call
request.getRequestURL()
:Given URL = http:/localhost:8080/sample/url.jsp?id1=something&id2=something&id3=something
it returns id1=something&id2=something&id3=something
See This