Why does the *getResource()* method in *ServletContextImpl* have the
following check
if (!path.startsWith("/")) {
throw
UndertowServletMessages.MESSAGES.pathMustStartWithSlash(path);
}
but the *getResourceAsStream()* method in the same class does not.
The ServletContext spec does say "*The path must begin with a / *" for the
*getResource()* method
https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContex...
And the *getResourceAsStream()* method also says that "*The path must be
specified according to the rules given in getResource*"
https://javaee.github.io/javaee-spec/javadocs/javax/servlet/ServletContex...
So it seems the same validation rules should apply to both methods.
Thanks!
~Brad
*Developer Advocate*
*Ortus Solutions, Corp *
E-mail: brad(a)coldbox.org
ColdBox Platform:
http://www.coldbox.org
Blog:
http://www.codersrevolution.com