galan / packtag

A JSP Taglib for delivering minified, combined and gzip-compressed resources (JavaScript and CSS).
Apache License 2.0
24 stars 13 forks source link

Fix a bug in a tomcat 8 environment #6

Closed eiggiotti closed 9 years ago

eiggiotti commented 9 years ago

Hi,

In a tomcat 8/java 8 environment, the method PackTag.storeFile() fails because of the way the directory path is computed.

For some reason, getServletContext().getRealPath("/foo") doesn't produce a path with a trailing slash in tomcat 8, which leads to a wrong path because of the concatenation that follows.

I managed to make it work in both cases (with or without a trailing slash) by using the FilenameUtils.concat() method from commons-io. I figured you wouldn't want to add the whole library in your dependencies just for that small use case, so I copied the relevant code of apache's FilenameUtils class into the utils package.

I hope you'll find this change useful. Let me know if you want me to change something in the pull request.

galan commented 9 years ago

Hi, thanks for your contribution! I will take a look at the commit, but I'm quite busy at the moment, hopefully next weekend is some time. Thanks for your patience.

galan commented 9 years ago

I merged your code, to do this I also changed my licence from LGPLv2.1 to ASLv2, otherwise they wouldn't be compatible.

eiggiotti commented 9 years ago

Great! Good catch for the license. Thank you for the merge.