Package com.caucho.server.webapp

Examples of com.caucho.server.webapp.WebAppController


    Path archivePath = null;

    if (contextUrl == null)
      contextUrl = webUri;

    WebAppController controller = null;

    if (webUri.endsWith(".war")) {
      // server/2a16
      String name = webUri.substring(0, webUri.length() - 4);
      int p = name.lastIndexOf('/');
      if (p > 0)
        name = name.substring(p + 1);

      // XXX:
      if (contextUrl.equals(""))
        contextUrl = "/" + name;

      if (contextUrl.endsWith(".war"))
        contextUrl = contextUrl.substring(0, contextUrl.length() - 4);

      Path expandPath = _webappsPath;

      try {
        expandPath.mkdirs();
      } catch (Exception e) {
        log.log(Level.WARNING, e.toString(), e);
      }

      archivePath = path;
      path = expandPath.lookup(name);
    } else {
      // server/2a15
      if (contextUrl.equals("")) {
        String name = webUri;
        int p = name.lastIndexOf('/');
        if (p > 0)
          name = name.substring(p + 1);
        contextUrl = "/" + name;
      }

      // server/2a17
      if (contextUrl.endsWith(".war"))
        contextUrl = contextUrl.substring(0, contextUrl.length() - 4);
    }

    if (! contextUrl.startsWith("/"))
      contextUrl = "/" + contextUrl;

    controller = findWebAppEntry(contextUrl);

    if (controller == null) {
      controller = new WebAppController(contextUrl,
                                        contextUrl,
                                        path,
                                        _container);

      _webApps.add(controller);
    }

    if (archivePath != null)
      controller.setArchivePath(archivePath);

    controller.setDynamicDeploy(true);

    if (_configException != null)
      controller.setConfigException(_configException);

    for (WebAppConfig config : web.getWebAppList())
      controller.addConfigDefault(config);
  }
View Full Code Here


   * Returns any matching web-app.
   */
  public WebAppController findWebAppEntry(String name)
  {
    for (int i = 0; i < _webApps.size(); i++) {
      WebAppController controller = _webApps.get(i);

      if (controller.isNameMatch(name))
        return controller;
    }

    return null;
  }
View Full Code Here

TOP

Related Classes of com.caucho.server.webapp.WebAppController

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.