Examples

Pierre PINON edited this page Jul 21, 2014 · 6 revisions

Download Examples

Download JettyBootstrap examples here !

Java Examples

Example 1

public class Main {
  public static void main(String[] args) throws JettyBootstrapException {
    JettyBootstrap.startSelf();
  }
}

Example 2

public class Main {
  public static void main(String[] args) throws JettyBootstrapException {
    JettyBootstrap jettyBootstrap = new JettyBootstrap();
    jettyBootstrap.addWarApp("/tmp/myApp.war");
    jettyBootstrap.startServer();
  }
}

Example 3

public class Main {
  public static void main(String[] args) throws JettyBootstrapException {
    JettyBootstrap jettyBootstrap = new JettyBootstrap();
    jettyBootstrap.addWarAppFromClasspath("/myApp.war");
    jettyBootstrap.startServer();
  }
}

Example 4

public class Main {
  public static void main(String[] args) throws JettyBootstrapException {
    JettyConfiguration jettyConfiguration = new JettyConfiguration();
    jettyConfiguration.setJettyConnectors(JettyConnector.HTTP, JettyConnector.HTTPS);
    jettyConfiguration.setRedirectWebAppsOnHttpsConnector(true);

    JettyBootstrap jettyBootstrap = new JettyBootstrap(jettyConfiguration);
    jettyBootstrap.addStaticResourceFromClasspath("/staticResource", "/staticContext");
    jettyBootstrap.addWarApp("/tmp/myWar.war", "/myApp");
    jettyBootstrap.startServer();
  }
}
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.