Look at the HttpServletRequest Object, which you can access from your JSP in a scriplet (although that's not pretty). It has many methods for getting the URL of the page, including the parameters. Methods of interest will be:
- getQueryString
- getRequestURI
- getRequestURL
Have a play with them.