Reputation: 557
This is my case, set by step:
localhost:8080/user/data/expenses
localhost:8080/user/data/change_button/9_2015
My question: How can I get information from what side was call my controller. I need exactly this information which is strong below:
localhost:8080 /user/data/expenses
M-Z
Upvotes: 0
Views: 553
Reputation: 5474
Infact there is way to get the referer of the request as it is part of the HTTP header. Just inject HttpServletRequest
to the mapped method then get the header named "referer".
request.getHeader("referer");
Upvotes: 1
Reputation: 17525
You need to inject the HttpServletRequest
and then use getRequestURI()
to get the data. Read the javadoc for @RequestMapping
.
Upvotes: 0