I want to get the current url of my application in Java Spring boot. But the problem is, I want to get that from the util class and not from Controller. I tried to get this from HttpServletRequest but I am unable to import its package into my util class.
Please help me to get the URL of my website which should not be hardcoded. Or if there is a way to use HttpServletRequest into my util class.