Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
8.0.0, 9.0.0-M3
-
None
Description
Hello!
WicketTester does not provide a useful MockServletContext#getResource(). As WicketTester always instantiates MockServletContext passing a null-Value as path (webappRoot), the method MockServletContext#getResource always returns null, even if a resource in the classpath exists.
My proposal for the implementation of Method MockServletContext#getResource() is:
URL result = null;
if (name.startsWith("/")) {
name = name.substring(1);
}
if (webappRoot != null) {
final File f = new File(webappRoot, name);
if (f.exists())
if (result == null) {
result = getClass().getClassLoader().getResource("META-INF/resources/" + name);
}
return result;
Best regards
Hans
Attachments
Attachments
Issue Links
- causes
-
WICKET-6755 MockServletContext does not decode real path
- Resolved
- links to