コード例 #1
0
  /**
   * Override to apply the equivalent of the stock "$CATALINA_BASE/conf/web.xml" to contexts
   * programmatically.
   */
  @Override
  protected synchronized void beforeStart() {
    super.beforeStart();

    ((SipStandardContext) context)
        .setJ2EEServer("MSS-Arquillian-7-" + UUID.randomUUID().toString());
    Tomcat.initWebappDefaults(context);
  };
コード例 #2
0
ファイル: Main.java プロジェクト: alitar87/TacProject
  public static void main(String[] args) throws Exception {

    final Tomcat tomcat = new Tomcat();
    tomcat.setBaseDir("."); // location where temp dir is created
    tomcat.setPort(8080);

    // configure context
    final File applicationPath = new File("./webapp"); // todo: change to your location
    Context rootContext =
        tomcat.addContext("/", "C:\\Users\\Ali\\git\\finder\\finder\\src\\main\\webapp");
    rootContext.addLifecycleListener(new ContextConfig());

    // JSP and Default Servlet setup, mime type mapping and welcome files
    Tomcat.initWebappDefaults(rootContext);

    // start server
    tomcat.start();
    tomcat.getServer().await();
  }
コード例 #3
0
ファイル: Tomcat.java プロジェクト: anoopgecbh/Tomcat-4
 /**
  * Provide default configuration for a context. This is the programmatic equivalent of the default
  * web.xml.
  *
  * <p>TODO: in normal Tomcat, if default-web.xml is not found, use this method
  *
  * @param contextPath The context to set the defaults for
  */
 public void initWebappDefaults(String contextPath) {
   Container ctx = getHost().findChild(contextPath);
   initWebappDefaults((Context) ctx);
 }