Get the URL from mJSP page

后端 未结 2 1620
情话喂你
情话喂你 2021-02-20 18:49

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

2条回答
  •  独厮守ぢ
    2021-02-20 19:12

    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.

提交回复
热议问题