// Set the location and server
this.location = "http://" + servername + ":" + port;
this.server = new Server(port);
final Context context = new Context(this.server, "/", Context.SESSIONS);
final DwrServlet servlet = new DwrServlet();
final ServletHolder servletholder = new ServletHolder(servlet);
servletholder.setInitParameter("debug", "true");
servletholder.setInitParameter("activeReverseAjaxEnabled", "true");
servletholder.setInitParameter("initApplicationScopeCreatorsAtStartup", "true");
servletholder.setInitParameter("jsonRpcEnabled", "true");
servletholder.setInitParameter("jsonpEnabled", "true");
servletholder.setInitParameter("preferDataUrlSchema", "false");
servletholder.setInitParameter("maxWaitAfterWrite", "-1");
servletholder.setInitParameter("jsonpEnabled", "true");
servletholder.setInitParameter("allowScriptTagRemoting", "true");
servletholder.setInitParameter("crossDomainSessionSecurity", "false");
servletholder.setInitParameter("overridePath", this.location);
servletholder.setInitParameter("allowGetForSafariButMakeForgeryEasier", "true");
context.addServlet(servletholder, "/*");
try {
this.server.start();
} catch (final Exception e) {
e.printStackTrace();
}
this.creatorManager = servlet.getContainer().getBean(CreatorManager.class);
this.converterManager = servlet.getContainer().getBean(ConverterManager.class);
}