I am using a Filter and the doFilter-Function. I would like to know which site is being requested. Some function giving me something like /firstDirectoryInWebDirectory/lala.jsp would be perfect.
What is the way to go here? Using the context will be the right way, but I can’t find any good method 🙁
Thanks
request.getRequestURI()should return the part of the URL after the domain.From there, you can strip the
request.getContextPath()(You’d have to cast the
ServletRequesttoHttpServletRequestfirst)