Package org.mortbay.jetty.handler

Examples of org.mortbay.jetty.handler.ResourceHandler


    @Test
    public void testHelloWorldExternalBindingFile() throws Exception {
        Server server = new Server(8585);

        ResourceHandler reshandler = new ResourceHandler();
        reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
        server.addHandler(reshandler);
        server.start();
        env.put(ToolConstants.CFG_WSDLURL, "http://localhost:8585/hello_world.wsdl");
        env.put(ToolConstants.CFG_BINDING, "http://localhost:8585/remote-hello_world_binding.xsd");
        processor.setContext(env);
        processor.execute();
        try {
            reshandler.stop();
        } finally {
            server.stop();
            server.destroy();
        }
View Full Code Here


    System.setProperty("jetty.port", String.valueOf(port));

    Server newServer = new Server(port);

    // Attach the test resources in /endtoend as static content for the test
    ResourceHandler resources = new ResourceHandler();
    URL resource = EndToEndTest.class.getResource("/endtoend");
    resources.setBaseResource(Resource.newResource(resource));
    newServer.addHandler(resources);

    Context context = new Context(newServer, "/", Context.SESSIONS);
    context.addEventListener(new GuiceServletContextListener());
View Full Code Here

    listener.setHost("127.0.0.1");
    webServer.addConnector(listener);
    ContextHandler staticContext = new ContextHandler();
    staticContext.setContextPath("/");
    staticContext.setResourceBase(staticContent);
    staticContext.addHandler(new ResourceHandler());
    webServer.addHandler(staticContext);
    return webServer;
  }
View Full Code Here

    @Test
    public void testHelloWorldExternalBindingFile() throws Exception {
        Server server = new Server(8585);

        ResourceHandler reshandler = new ResourceHandler();
        reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
        server.addHandler(reshandler);
        server.start();
        env.put(ToolConstants.CFG_WSDLURL, "http://localhost:8585/hello_world.wsdl");
        env.put(ToolConstants.CFG_BINDING, "http://localhost:8585/remote-hello_world_binding.xsd");
        processor.setContext(env);
        processor.execute();
        try {
            reshandler.stop();
        } finally {
            server.stop();
            server.destroy();
        }
View Full Code Here

    @Test
    public void testHelloWorldExternalBindingFile() throws Exception {
        Server server = new Server(8585);

        ResourceHandler reshandler = new ResourceHandler();
        reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
        server.addHandler(reshandler);
        server.start();
        env.put(ToolConstants.CFG_WSDLURL, "http://localhost:8585/hello_world.wsdl");
        env.put(ToolConstants.CFG_BINDING, "http://localhost:8585/remote-hello_world_binding.xsd");
        processor.setContext(env);
        processor.execute();
        try {
            reshandler.stop();
        } finally {
            server.stop();
            server.destroy();
        }
View Full Code Here

    }

    @Test
    public void testHelloWorldExternalBindingFile() throws Exception {
        Server server = new Server(8585);
        ResourceHandler reshandler = new ResourceHandler();
        reshandler.setResourceBase(getLocation("/wsdl2java_wsdl/"));
        server.addHandler(reshandler);
        server.start();
        env.put(ToolConstants.CFG_WSDLURL, "http://localhost:8585/hello_world.wsdl");
        env.put(ToolConstants.CFG_BINDING, "http://localhost:8585/remote-hello_world_binding.xsd");
        processor.setContext(env);
View Full Code Here

    private void addResourcesAndWelcomeFiles(final HandlerList handlers) {
        for (final WebAppSpecification specification : getSpecifications()) {
            final List<String> files = specification.getWelcomeFiles();
            final String[] welcomeFiles = files.toArray(new String[files.size()]);
            for (final String resourcePath : specification.getResourcePaths()) {
                final ResourceHandler resourceHandler = new ResourceHandler();
                resourceHandler.setResourceBase(resourcePath);
                resourceHandler.setWelcomeFiles(welcomeFiles);
                handlers.addHandler(resourceHandler);
            }
        }
    }
View Full Code Here

    public static void runJettyServer() throws Exception {
        Server server = new Server(8081);

        Context root = new Context(server, "/");
        root.setResourceBase("./pom.xml");
        root.setHandler(new ResourceHandler());

        server.setStopAtShutdown(true);
        server.start();
    }
View Full Code Here

    private void addResourcesAndWelcomeFiles(final HandlerList handlers) {
        for (final WebAppSpecification specification : getSpecifications()) {
            final List<String> files = specification.getWelcomeFiles();
            final String[] welcomeFiles = files.toArray(new String[files.size()]);
            for (final String resourcePath : specification.getResourcePaths()) {
                final ResourceHandler resourceHandler = new ResourceHandler();
                resourceHandler.setResourceBase(resourcePath);
                resourceHandler.setWelcomeFiles(welcomeFiles);
                handlers.addHandler(resourceHandler);
            }
        }
    }
View Full Code Here

        ResourceFactory.getResourceChangeNotifierService().start();
        ResourceFactory.getResourceChangeScannerService().start();

        this.server = new Server(0);
        ResourceHandler resourceHandler = new ResourceHandler();
        resourceHandler.setResourceBase(fileManager.getRootDirectory().getPath());

        server.setHandler(resourceHandler);

        server.start();
View Full Code Here

TOP

Related Classes of org.mortbay.jetty.handler.ResourceHandler

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.