Examples of addServletWithMapping()


Examples of org.eclipse.jetty.servlet.ServletHandler.addServletWithMapping()

        // instance of that Servlet and mount it on a given context path.

        // IMPORTANT:
        // This is a raw Servlet, not a Servlet that has been configured
        // through a web.xml @WebServlet annotation, or anything similar.
        handler.addServletWithMapping(HelloServlet.class, "/*");

        // Start things up!
        server.start();

        // The use of server.join() the will make the current thread join and
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler.addServletWithMapping()

    private final Server server;

    public ExampleServer(Servlet servlet, String urlPattern) {
      ServletHolder holder = new ServletHolder(servlet);
      ServletHandler handler = new ServletHandler();
      handler.addServletWithMapping(holder, urlPattern);
      server = new Server(0);
      server.setHandler(handler);
    }

    public void start() throws Exception {
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler.addServletWithMapping()

  private final Server server;

  public ExampleServer(Servlet servlet, String urlPattern) {
    ServletHolder holder = new ServletHolder(servlet);
    ServletHandler handler = new ServletHandler();
    handler.addServletWithMapping(holder, urlPattern);
    server = new Server(0);
    server.setHandler(handler);
  }

  public void start() throws Exception {
View Full Code Here

Examples of org.eclipse.jetty.servlet.ServletHandler.addServletWithMapping()

 
  private void startServer() throws Exception {
    ServletHandler replicationHandler = new ServletHandler();
    ReplicationService service = new ReplicationService(Collections.singletonMap("s1", serverReplicator));
    ServletHolder servlet = new ServletHolder(new ReplicationServlet(service));
    replicationHandler.addServletWithMapping(servlet, ReplicationService.REPLICATION_CONTEXT + "/*");
    server = newHttpServer(replicationHandler);
    port = serverPort(server);
    host = serverHost(server);
  }
 
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

                    ServletHandler handler = new ServletHandler();
                    Class servletClass = servletClassName == null ?
                            EmbeddedServletClient.class : Class.forName(servletClassName);

                    ServletHolder holder = new ServletHolder(servletClass);
                    handler.addServletWithMapping(holder, "/*");

                    holder.setInitParameter("application", appName);
                    // holder.setInitParameter("mountpoint", mountpoint);

                    if (cookieDomain != null) {
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

    contextHandler.setAttribute( "action", "/Query" );
    // TODO: very rudimentary: we should get the template from somewhere else instead...
    contextHandler.setAttribute( "template", System.getProperty( "it.unimi.dsi.mg4j.query.QueryServlet.template" ) );

    // Maps the main servlet onto the container.
    servlets.addServletWithMapping( QueryServlet.class, "/Query" );
    servlets.addServletWithMapping( HelpPage.class, "/Help" );
   
    /* If an item servlet was specified, we link it to /Item. Otherwise,
     * we inform the query servlet that it should generate direct URIs. */

 
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

    // TODO: very rudimentary: we should get the template from somewhere else instead...
    contextHandler.setAttribute( "template", System.getProperty( "it.unimi.dsi.mg4j.query.QueryServlet.template" ) );

    // Maps the main servlet onto the container.
    servlets.addServletWithMapping( QueryServlet.class, "/Query" );
    servlets.addServletWithMapping( HelpPage.class, "/Help" );
   
    /* If an item servlet was specified, we link it to /Item. Otherwise,
     * we inform the query servlet that it should generate direct URIs. */

    if ( itemClass != null ) {
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

   
    /* If an item servlet was specified, we link it to /Item. Otherwise,
     * we inform the query servlet that it should generate direct URIs. */

    if ( itemClass != null ) {
      servlets.addServletWithMapping( itemClass, "/Item" );
      if ( itemClass == FileSystemItem.class ) contextHandler.setAttribute( "derelativise", Boolean.TRUE );
    }
    else contextHandler.setAttribute( "uri", Boolean.TRUE );

    contextHandler.setAttribute( "mimeType", itemMimeType );
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

        server.setConnectors(new Connector[]{connector});
       
        ServletHandler handler=new ServletHandler();
        server.setHandler(handler);
       
        handler.addServletWithMapping("org.mortbay.jetty.example.MinimalServlets$HelloServlet", "/");
       
        server.start();
        server.join();
    }
View Full Code Here

Examples of org.mortbay.jetty.servlet.ServletHandler.addServletWithMapping()

        server.setConnectors(new Connector[]
        { connector });

        ServletHandler handler = new ServletHandler();
        TestServlet servlet = new TestServlet();
        handler.addServletWithMapping(new ServletHolder(servlet),"/test");
        server.addHandler(handler);
       
        try
        {
            SSLContext context = SSLContext.getInstance("SSL");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.