Package com.sun.jersey.spi.container.servlet

Examples of com.sun.jersey.spi.container.servlet.ServletContainer


                securityFilter.configure(properties.getConfiguration());
                rc.getContainerRequestFilters().add(securityFilter);
            }

            final ServletRegistration sg = wacJersey.addServlet("jersey", new ServletContainer(rc));
            sg.addMapping("/*");
            wacJersey.deploy(this.httpServer);
        }
    }
View Full Code Here


        // Jersey web resources
        ServletAdapter jerseyAdapter = new ServletAdapter();
        jerseyAdapter.addInitParameter("com.sun.jersey.config.property.packages", "us.monoid.web.ssl");
        jerseyAdapter.setContextPath("/");

        jerseyAdapter.setServletInstance(new ServletContainer());

        // register all above defined adapters
        webServer.addGrizzlyAdapter(jerseyAdapter, new String[] {"/"});

        // let Grizzly run
View Full Code Here

    private void rawRegisterServlets() throws ServletException, NamespaceException, InterruptedException {
        logger.info("JERSEY BUNDLE: REGISTERING SERVLETS");
        logger.info("JERSEY BUNDLE: HTTP SERVICE = " + httpService.toString());

        httpService.registerServlet("/jersey-http-service", new ServletContainer(), getJerseyServletParams(), null);

        sendAdminEvent();
        logger.info("JERSEY BUNDLE: SERVLETS REGISTERED");
    }
View Full Code Here

        DynamicPropertyFactory
            .getInstance()
            .getStringProperty("jersey.resources.package",
                "not-found-in-configuration").get());
   
    final ServletContainer container = new ServletContainer(rcf);
    context.addServlet(new ServletHolder(container), "/service/*");

    // enable hystrix.stream
    context.addServlet(HystrixMetricsStreamServlet.class, "/hystrix.stream");
 
View Full Code Here

  }

  @Bean
  public FilterRegistrationBean jersey() {
    FilterRegistrationBean bean = new FilterRegistrationBean();
    bean.setFilter(new ServletContainer());
    bean.addInitParameter("com.sun.jersey.config.property.packages",
        "com.sun.jersey;sample.jersey1");
    return bean;
  }
View Full Code Here

        Collections.sort(linkResources);
        Collections.sort(scriptResources);
        Collections.sort(navigationLinks);

        // bind the aggregate JAX-RS application to a dedicated servlet
        ServletContainer container = new ServletContainer(app);
        Bundle appBundle = componentContext.getBundleContext().getBundle();
        httpService.registerServlet(applicationAlias, container, getInitParams(), new BundleHttpContext(
                appBundle));
        registeredAliases.add(applicationAlias);

        // forward the main Stanbol OSGi runtime context so that JAX-RS resources can lookup arbitrary
        // services
        servletContext = container.getServletContext();
        servletContext.setAttribute(BundleContext.class.getName(), componentContext.getBundleContext());
        servletContext.setAttribute(BaseStanbolResource.ROOT_URL, applicationAlias);
        servletContext.setAttribute(BaseStanbolResource.STATIC_RESOURCES_ROOT_URL, staticUrlRoot);
        servletContext.setAttribute(BaseStanbolResource.LINK_RESOURCES, linkResources);
        servletContext.setAttribute(BaseStanbolResource.SCRIPT_RESOURCES, scriptResources);
View Full Code Here

      Server server = new Server(port);
      ServletContextHandler context = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
      context.setContextPath("/");
      server.setHandler(context);

      context.addServlet(new ServletHolder(new ServletContainer(new PackagesResourceConfig("org.apache.tika.server"))), "/*");

      server.start();

      logger.info("Started");

View Full Code Here

        builder.shutdownProc(makeShutdownProc(this));
        exhibitor = new Exhibitor(configProvider, null, backupProvider, builder.build());
        exhibitor.start();

        DefaultResourceConfig   application = JerseySupport.newApplicationConfig(new UIContext(exhibitor));
        ServletContainer        container = new ServletContainer(application);
        server = new Server(httpPort);
        Context root = new Context(server, "/", Context.SESSIONS);
        root.addServlet(new ServletHolder(container), "/*");
        if ( security != null )
        {
View Full Code Here

                       FilterMapping.REQUEST);
        root.addFilter(fHolder, "/" + SERVLET_PATH + "/v1/version/*",
                       FilterMapping.REQUEST);

        // Connect Jersey
        ServletHolder h = new ServletHolder(new ServletContainer(makeJerseyConfig()));
        root.addServlet(h, "/" + SERVLET_PATH + "/*");
        // Add any redirects
        addRedirects(server);

        // Start the server
View Full Code Here

        Collections.sort(linkResources);
        Collections.sort(scriptResources);
        Collections.sort(navigationLinks);

        // bind the aggregate JAX-RS application to a dedicated servlet
        ServletContainer container = new ServletContainer(app);
        Bundle appBundle = componentContext.getBundleContext().getBundle();
        httpService.registerServlet(applicationAlias, container, getInitParams(), new BundleHttpContext(
                appBundle));
        registeredAliases.add(applicationAlias);

        // forward the main Stanbol OSGi runtime context so that JAX-RS resources can lookup arbitrary
        // services
        servletContext = container.getServletContext();
        servletContext.setAttribute(BundleContext.class.getName(), componentContext.getBundleContext());
        servletContext.setAttribute(BaseStanbolResource.ROOT_URL, applicationAlias);
        servletContext.setAttribute(BaseStanbolResource.STATIC_RESOURCES_ROOT_URL, staticUrlRoot);
        servletContext.setAttribute(BaseStanbolResource.LINK_RESOURCES, linkResources);
        servletContext.setAttribute(BaseStanbolResource.SCRIPT_RESOURCES, scriptResources);
View Full Code Here

TOP

Related Classes of com.sun.jersey.spi.container.servlet.ServletContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.