ServletContextResource getFile should not rely on getRealPath (for WebLogic 10 compatibility) [SPR-8461] #13107
When using the ResourceHttpRequestHandler to serve static resources the ServletContextResource's getFile() method that is used doesn't work when not deploying exploded.
Here is the scenario:
I was able to work around this issue by creating and plugging in a custom ServletContextResource class that overrides the getFile() method and does this:
I have tested this using Weblogic 10.3 deployed exploded, not exploded, and using the eclipse plugin which is basically exploded.
Affects: 3.0.5, 3.1 M1, 3.1 M2
4 votes, 6 watchers
The text was updated successfully, but these errors were encountered:
Juergen Hoeller commented
We fixed this for tomorrow's 3.1 RC2 and also for the upcoming 3.0.7 release which will go out in late December. The fix is a bit different but will have the same effect: We check for "file:" URLs and simply call super.getFile() in that case since AbstractFileResolvingResource has proper code for that purpose already.
For overriding the default ServletContextResource implementation, you'd have to override your ApplicationContext's getResourceByPath implementation accordingly, returning a custom Resource class instead. Hopefully 3.1 RC2 (or 3.0.7) will be out early enough for your purposes.
Piotr Findeisen commented
We recently upgraded from Spring 3.0.5 to Spring 3.1 and... is there any way to get the legacy behavior in
I'm running on JBoss 4.2.3 and have