How to get the previous page URL from request in servlet after dispatcher.forward(request, response)

前端 未结 4 1739
借酒劲吻你
借酒劲吻你 2020-12-17 16:18

I\'m using the servlet which redirects me with the help of

dispatcher.forward(request, response);

in the end. But after this I want to get

4条回答
  •  眼角桃花
    2020-12-17 16:53

    Try using

    request.getAttribute("javax.servlet.forward.request_uri")  
    

    See
    https://tomcat.apache.org/tomcat-9.0-doc/servletapi/constant-values.html
    and
    How to get the url of the client

提交回复
热议问题