addRestServlet(root, "keystore", KeyStore.class);
addRestServlet(root, "truststore", TrustStore.class);
addRestServlet(root, "plugin", Plugin.class);
addRestServlet(root, "preferencesprovider", AuthenticationProvider.class, PreferencesProvider.class);
root.addServlet(new ServletHolder(new UserPreferencesServlet()), "/rest/userpreferences/*");
root.addServlet(new ServletHolder(new LoggedOnUserPreferencesServlet()), "/rest/preferences");
root.addServlet(new ServletHolder(new StructureServlet()), "/rest/structure");
root.addServlet(new ServletHolder(new MessageServlet()), "/rest/message/*");
root.addServlet(new ServletHolder(new MessageContentServlet()), "/rest/message-content/*");
root.addServlet(new ServletHolder(new LogRecordsServlet()), "/rest/logrecords");
root.addServlet(new ServletHolder(new SaslServlet()), "/rest/sasl");
root.addServlet(new ServletHolder(new DefinedFileServlet("index.html")), HttpManagementUtil.ENTRY_POINT_PATH);
root.addServlet(new ServletHolder(new DefinedFileServlet("index.html")), "/");
root.addServlet(new ServletHolder(new LogoutServlet()), "/logout");
root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoPath(), true)), "/dojo/dojo/*");
root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDijitPath(), true)), "/dojo/dijit/*");
root.addServlet(new ServletHolder(new FileServlet(DojoHelper.getDojoxPath(), true)), "/dojo/dojox/*");
root.addServlet(new ServletHolder(new FileServlet()), "*.js");
root.addServlet(new ServletHolder(new FileServlet()), "*.css");
root.addServlet(new ServletHolder(new FileServlet()), "*.html");
root.addServlet(new ServletHolder(new FileServlet()), "*.png");
root.addServlet(new ServletHolder(new FileServlet()), "*.gif");
root.addServlet(new ServletHolder(new FileServlet()), "*.jpg");
root.addServlet(new ServletHolder(new FileServlet()), "*.jpeg");
root.addServlet(new ServletHolder(new FileServlet()), "*.json");
root.addServlet(new ServletHolder(new FileServlet()), "*.txt");
root.addServlet(new ServletHolder(new FileServlet()), "*.xsl");
root.addServlet(new ServletHolder(new HelperServlet()), "/rest/helper");
root.addServlet(new ServletHolder(new LogFileListingServlet()), "/rest/logfilenames");
root.addServlet(new ServletHolder(new LogFileServlet()), "/rest/logfile");
final SessionManager sessionManager = root.getSessionHandler().getSessionManager();
sessionManager.setSessionCookie(JSESSIONID_COOKIE_PREFIX + lastPort);
sessionManager.setMaxInactiveInterval((Integer)getAttribute(TIME_OUT));