Examples of Webapp


Examples of com.caucho.server.webapp.WebApp

 
  public void configureRootPath(Path root)
  {
    String ejbModuleName = null;
   
    WebApp webApp = WebApp.getCurrent();
   
    if (webApp != null)
      ejbModuleName = webApp.getWarName();
    else
      ejbModuleName = getEjbModuleName(root);

    Path ejbJarXml = getEjbJarPath(root);
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

      addHeader(stream, ws, "QUERY_STRING", "");

    String scriptPath = req.getServletPath();
    String pathInfo = req.getPathInfo();

    WebApp webApp = (WebApp) req.getServletContext();

    Path appDir = webApp.getRootDirectory();
    String realPath = webApp.getRealPath(scriptPath);

    if (! appDir.lookup(realPath).isFile() && pathInfo != null)
      scriptPath = scriptPath + pathInfo;

    /*
     * FastCGI (specifically quercus) uses the PATH_INFO and PATH_TRANSLATED
     * for the script path.
     */
    log.finer("STREAM file: " + webApp.getRealPath(scriptPath));

    addHeader(stream, ws, "PATH_INFO", req.getContextPath() + scriptPath);
    addHeader(stream, ws, "PATH_TRANSLATED", webApp.getRealPath(scriptPath));

    /* These are the values which would be sent to CGI.
    addHeader(stream, ws, "SCRIPT_NAME", req.getContextPath() + scriptPath);
    addHeader(stream, ws, "SCRIPT_FILENAME", app.getRealPath(scriptPath));

    if (pathInfo != null) {
      addHeader(stream, ws, "PATH_INFO", pathInfo);
      addHeader(stream, ws, "PATH_TRANSLATED", req.getRealPath(pathInfo));
    }
    else {
      addHeader(stream, ws, "PATH_INFO", "");
      addHeader(stream, ws, "PATH_TRANSLATED", "");
    }
    */

    int contentLength = req.getContentLength();
    if (contentLength < 0)
      addHeader(stream, ws, "CONTENT_LENGTH", "0");
    else
      addHeader(stream, ws, "CONTENT_LENGTH", String.valueOf(contentLength));

    ServletContext rootContext = webApp.getContext("/");

    if (rootContext != null)
      addHeader(stream, ws, "DOCUMENT_ROOT", rootContext.getRealPath("/"));

    CharBuffer cb = new CharBuffer();
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

  private BundleManager _bundleManager;

  public ApplicationImpl()
  {
    WebApp webApp = WebApp.getLocal();

    JspFactory jspFactory = JspFactory.getDefaultFactory();

    JspApplicationContext appContext
      = jspFactory.getJspApplicationContext(webApp);

    _defaultNavigationHandler = new NavigationHandlerImpl();

    _bundleManager = BundleManager.create();

    _jsfExpressionFactory = appContext.getExpressionFactory();

    ELResolver []customResolvers = new ELResolver[0];
    _elResolver = new FacesContextELResolver(customResolvers,
                                             _bundleResolver);

    setViewHandler(new JspViewHandler());

    SessionStateManager stateManager = new SessionStateManager();
   
    JsfPropertyGroup jsfPropertyGroup = webApp.getJsf();

    if (jsfPropertyGroup != null)
      stateManager.setStateSerializationMethod(
        jsfPropertyGroup.getStateSerializationMethod());
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

    if (_charEncoding == null || "".equals(_charEncoding))
      charEncoding = null;

    if (charEncoding == null) {
      //XXX performance?
      WebApp webApp = WebApp.getCurrent();

      if (webApp.getJsp() != null)
        charEncoding = webApp.getJsp().getPageEncoding();

      if (charEncoding == null)
        charEncoding = webApp.getCharacterEncoding();
    }

    return charEncoding;
  }
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

  private String _developerAidLinkStyle;

  public JsfDeveloperAid()
  {
    WebApp webApp = WebApp.getCurrent();

    _developerAidLinkStyle = webApp.getJsf().getDeveloperAidLinkStyle();
  }
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

      _protocolContainer = (ProtocolContainer) cl.newInstance();
    } catch (Exception e) {
      throw new ServletException(e);
    }

    WebApp app = (WebApp) getServletContext();

    // need to initialize in the case of message driven beans.
    //if (containerId == null)
    //  containerId = app.getURL();
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

    throws ServletException
  {
    if (_urlPrefix != null)
      return;
   
    WebApp app = (WebApp) getServletContext();

    // calculate the URL prefix
    _servletId = req.getServletPath();

    CharBuffer cb = CharBuffer.allocate();

    if (! "default".equals(app.getAdmin().getHost().getName())
        && ! "".equals(app.getAdmin().getHost().getName())) {
      String hostName = app.getAdmin().getHost().getURL();

      cb.append(hostName);
      cb.append(app.getContextPath());
      cb.append(_servletId);
    }
    else {
      cb.append(req.getScheme());
      cb.append("://");
      cb.append(req.getServerName());
      cb.append(":");
      cb.append(req.getServerPort());
      cb.append(app.getContextPath());
      cb.append(_servletId);
    }
 
    _urlPrefix = cb.close();
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

  private void normalizeId()
  {
    if (_urlPrefix == null)
      return;

    WebApp application = (WebApp) getServletContext();
    String hostName = "localhost"; // application.getHost();
    String contextPath = application.getContextPath();

    if (_urlPrefix.startsWith("/")) {
      _servletId = _urlPrefix;
      _urlPrefix = application.getURL() + _urlPrefix;
    }
    else if (_urlPrefix.startsWith("http://")) {
      int p = _urlPrefix.indexOf('/', "http://".length());

      String uri = _urlPrefix;
      if (p > 0)
        uri = _urlPrefix.substring(p);
      else
        uri = "";

      if (uri.startsWith(contextPath))
        _servletId = uri.substring(contextPath.length());
      else if (_servletId == null)
        _servletId = uri;
    }
    else if (_urlPrefix.startsWith("https://")) {
      int p = _urlPrefix.indexOf('/', "https://".length());

      String uri = _urlPrefix;
      if (p > 0)
        uri = _urlPrefix.substring(p);
      else
        uri = "";

      if (uri.startsWith(contextPath))
        _servletId = uri.substring(contextPath.length());
      else if (_servletId == null)
        _servletId = uri;
    }
    else if (_urlPrefix.startsWith("cron:")) {
      _urlPrefix = application.getURL() + _servletId;
    }
    else
      _servletId = _urlPrefix;

    if (_servletId.equals(""))
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

    else if (path.charAt(0) == '/')
      return getWebApp().getRequestDispatcher(path);
    else {
      CharBuffer cb = new CharBuffer();

      WebApp webApp = getWebApp();

      String servletPath = getPageServletPath();
      if (servletPath != null)
        cb.append(servletPath);
      String pathInfo = getPagePathInfo();
      if (pathInfo != null)
        cb.append(pathInfo);

      int p = cb.lastIndexOf('/');
      if (p >= 0)
        cb.setLength(p);
      cb.append('/');
      cb.append(path);

      if (webApp != null)
        return webApp.getRequestDispatcher(cb.toString());

      return null;
    }
  }
View Full Code Here

Examples of com.caucho.server.webapp.WebApp

   */
  public boolean isIgnoreClientDisconnect()
  {
    // server/183c

    WebApp webApp = getWebApp();

    if (webApp != null)
      return webApp.isIgnoreClientDisconnect();
    else
      return true;
  }
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.