try {
context = new ServletContextHandler(server, ninjaContextPath);
NinjaPropertiesImpl ninjaProperties
= new NinjaPropertiesImpl(ninjaMode);
// We are using an embeded jetty for quick server testing. The
// problem is that the port will change.
// Therefore we inject the server name here:
ninjaProperties.setProperty(NinjaConstant.serverName, serverUri.toString());
ninjaServletListener.setNinjaProperties(ninjaProperties);
context.addEventListener(ninjaServletListener);