I would grab the URL of the current JSP web page with its settings example: index.jsp? param = 12
Have you any idea? Thank you
I would grab the URL of the current JSP web page with its settings example: index.jsp? param = 12
Have you any idea? Thank you
You can get it from the
HttpServletRequest
object which is in EL available by${pageContext.request}
. The part before the?
is available bygetRequestURL()
method and the part after the?
is available bygetQueryString()
method. So, in a nutshell:If you want to do this using normal Java code, you'd better use a Servlet for this.
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:
Have a play with them.