This is a special case where I am stuck dealing with an “enterprise” webapp. The enterprise app is calling request.getContext() and comparing it to another string.
I see I can get the servlet context path using getServletContext.getContextPath(). Is it possible to set the request context path from inside a servlet?
You cannot set it, but you can change its outcome with help of
HttpServletRequestWrapper.Create a
Filterwhich does basically the following indoFilter()method and map it as an early filter on URL pattern of interest.