spec addJspFile javadoc expect IllegalArgumentException if name is null or empty string (#4510)
* spec javadoc expect IllegalArgumentException if name is null or empty string Signed-off-by: olivier lamy <oliver.lamy@gmail.com>
This commit is contained in:
parent
158789b766
commit
9b9771d77d
|
@ -1078,7 +1078,7 @@ public class ServletContextHandler extends ContextHandler
|
|||
throw new IllegalStateException();
|
||||
|
||||
if (StringUtil.isBlank(name))
|
||||
throw new IllegalStateException("Missing name");
|
||||
throw new IllegalArgumentException("Missing name");
|
||||
|
||||
if (!_enabled)
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
|
@ -1028,6 +1028,9 @@ public class ServletContextHandlerTest
|
|||
}
|
||||
}
|
||||
|
||||
assertThrows(IllegalArgumentException.class, () -> root.getServletContext().addJspFile(null, "/path/to/some.jsp"));
|
||||
assertThrows(IllegalArgumentException.class, () -> root.getServletContext().addJspFile("", "/path/to/some.jsp"));
|
||||
|
||||
root.addBean(new MySCIStarter(root.getServletContext(), new JSPAddingSCI()), true);
|
||||
_server.start();
|
||||
MappedResource<ServletHolder> mappedServlet = root.getServletHandler().getMappedServlet("/somejsp/xxx");
|
||||
|
|
Loading…
Reference in New Issue