prabhuish / webutilities

Automatically exported from code.google.com/p/webutilities
0 stars 0 forks source link

Enhancement: allow URL's in CSS to be rewritten using a custom contextPath #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
PROBLEM:

I'm developing a website on Tomcat locally under the following URL

http://localhost:8080/MyProject/

After devving I deploy it to:

mydomainname.com/

I don't want to bother users with a MyProject/ context path so I use these 
rewrite rules in Apache:

ProxyPass / ajp://localhost:8009/MyProject/
ProxyPassReverse / ajp://localhost:8009/MyProject/

When using JSCSSMergeServlet URL's in the CSS are nicely rewritten to something 
like this: /MyProject/somecssdir/someimg.png

This works locally but not on my domain name where it needs to be 
/somecssdir/someimg.png

SOLUTION:
Add an optional init parameter so users are able to override the default 
contextPath: taken from the request: request.getContextPath() with a custom 
context path.

PATCH (tested):
See included attachment.

Original issue reported on code.google.com by wouter...@gmail.com on 13 Oct 2011 at 9:50

GoogleCodeExporter commented 9 years ago
Thanks for the patch. I will apply it.

Original comment by rr.patil...@gmail.com on 15 Oct 2011 at 6:34

GoogleCodeExporter commented 9 years ago

Original comment by rr.patil...@gmail.com on 15 Oct 2011 at 8:36

GoogleCodeExporter commented 9 years ago
Changes made - http://code.google.com/p/webutilities/source/detail?r=238

Original comment by rr.patil...@gmail.com on 15 Oct 2011 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by rr.patil...@gmail.com on 15 Oct 2011 at 7:10