urlrewritefilter
urlrewritefilter copied to clipboard
Loading config from servlet 3 web-fragment classpath fails
To reproduce:
1. Create a web-fragment with "/META-INF/resources/WEB-INF/urlrewrite.xml".
2. Set "confPath" to "classpath:/WEB-INF/urlrewrite.xml"
3. Start the app.
The application should catch the MalformedURLException thrown by attempting to
use a "classpath:" prefix on UrlRewriteFilter:270, and progress on to line 273,
where using the ClassLoader processes it just fine.
Maven: org.tuckey:urlrewritefilter:4.0.3
Server: JBoss 6.1.0.Final (apache tomcat)
OS: Windows 8 x64, JDK 7
Related tangentially to:
https://code.google.com/p/urlrewritefilter/issues/detail?id=150
Should only require changing:
InputStream inputStream = context.getResourceAsStream(confPath);
to:
InputStream inputStream = null;
try {
inputStream = context.getResourceAsStream(confPath);
} catch (MalformedURLException e) {
log.debug(e);
}
Original issue reported on code.google.com by [email protected] on 1 Jul 2014 at 2:24
Ok, so after fiddling around with the code, the issue isn't as straightforward
as I had thought. I'll do some more investigation and submit a patch to fix the
issue.
Original comment by [email protected] on 1 Jul 2014 at 2:49
The attached patch should fix both this issue and issue #150, as well as making
the code clearer, with less redundancy.
Original comment by [email protected] on 1 Jul 2014 at 3:19
Attachments:
Apologies if the tests are failing. I'll see about sorting that out tomorrow.
I'm maintaining a fork of the code at https://github.com/Tzrlk/UrlRewriteFilter/
Original comment by [email protected] on 1 Jul 2014 at 5:19