Java get referent URI?

I need the same method as getRequestURI () , but I want to use it in the referrer. Is it possible?

I would like to turn http://www.example.com/my/path?vars=true into /my/path

+6
source share
1 answer

Do you need something like this?

 String refererURI = new URI(request.getHeader("referer")).getPath(); 
+7
source

Source: https://habr.com/ru/post/923082/