//Add ExceptionMapper and create Container
register(exceptionMapperClass);
GrizzlyHttpContainer grizzlyHttpContainer = ContainerFactory.createContainer(GrizzlyHttpContainer.class, this);
// Set our ServerConfiguration options
final ServerConfiguration config = httpServer.getServerConfiguration();
config.addHttpHandler(grizzlyHttpContainer, configuration.getHttpServer().getRootContext());
config.setPassTraceRequest(configuration.getHttpServer().isPassTraceRequest());
config.setTraceEnabled(configuration.getHttpServer().isTraceEnabled());
config.setJmxEnabled(configuration.getHttpServer().isJmxEnabled());
//Configure static resource handler if required
if (configuration.getHttpServer().getStaticResourceDirectory() != null &&
configuration.getHttpServer().getStaticResourceContextRoot() != null)
config.addHttpHandler(new StaticHttpHandler(configuration.getHttpServer().getStaticResourceDirectory()),
configuration.getHttpServer().getStaticResourceContextRoot());
// Now an HttpServer and NetworkListener
final NetworkListener listener = new NetworkListener("grizzly",
configuration.getHttpServer().getHost(), configuration.getHttpServer().getPort());