I have web application, which was designed and always worked under root context ("/"). So all css, js and links started with "/" (for example "/css/style.css"). Now I need to move this web application to some different context (let's say /app1). It is easy to change server.xml configuration file and bring up web application in new context "app1" using [Context path=""] item. But web pages are broken because all links are now incorrect. They point to old root context ("/css/style.css") instead of new "app1" context. Is there any magic way to fix this problem without fixing each link by prefixing with some "context" variable? Used server - Tomcat 5. Application is written with Java and uses JSP, Struts2, Spring and UrlRewrite filter. More interesting is to hear real experience in fighting with such problems that theoretical debates. Thank you.
P.S. I do not see how UrlRewrite filter can help me because it will work only in 'app1' context. So requests to links like '/css/style.css' will not be passed to it.