}
protected Servlet addServlet(WebApp webApp, String name,
String classname, String pattern, String loadOnStartup) throws IOException {
Servlet servlet = (Servlet) createBean(webApp, "Servlet");
servlet.setServletName(name);
servlet.setServletClass(classname);
if (loadOnStartup != null) {
servlet.setLoadOnStartup(new BigInteger(loadOnStartup));
}
webApp.addServlet(servlet);
if (pattern != null) {
addServletMapping(webApp, name, pattern);
}