Examples of WebXml


Examples of ch.entwine.weblounge.kernel.http.WebXml

    Thread t = new Thread(new Runnable() {

      public void run() {

        Bundle siteBundle = siteManager.getSiteBundle(site);
        WebXml webXml = createWebXml(site, siteBundle);
        Properties initParameters = new Properties();

        // Prepare the init parameters
        // initParameters.put("load-on-startup", Integer.toString(1));
        initParameters.putAll(webXml.getContextParams());
        initParameters.putAll(jasperConfig);

        // Create the site URI
        String contextRoot = webXml.getContextParam(DispatcherConfiguration.WEBAPP_CONTEXT_ROOT, DEFAULT_WEBAPP_CONTEXT_ROOT);
        String bundleURI = webXml.getContextParam(DispatcherConfiguration.BUNDLE_URI, site.getIdentifier());
        String siteContextURI = webXml.getContextParam(DispatcherConfiguration.BUNDLE_CONTEXT_ROOT_URI, DEFAULT_BUNDLE_CONTEXT_ROOT_URI);
        String siteRoot = UrlUtils.concat(contextRoot, siteContextURI, bundleURI);

        // Prepare the Jasper work directory
        String scratchDirPath = PathUtils.concat(jasperConfig.get(OPT_JASPER_SCRATCHDIR), site.getIdentifier());
        File scratchDir = new File(scratchDirPath);
View Full Code Here

Examples of com.google.apphosting.utils.config.WebXml

    String pathInfo;

    AppEngineWebXml appEngineWebXml = (AppEngineWebXml) getServletContext().getAttribute(
        "com.google.appengine.tools.development.appEngineWebXml");

    WebXml webXml = (WebXml) getServletContext().getAttribute(
        "com.google.appengine.tools.development.webXml");

    Boolean forwarded = (Boolean) request.getAttribute(Dispatcher.__FORWARD_JETTY);
    if (forwarded == null) {
      forwarded = Boolean.FALSE;
    }

    Boolean included = (Boolean) request.getAttribute(Dispatcher.__INCLUDE_JETTY);
    if (included != null && included) {
      servletPath = (String) request.getAttribute(Dispatcher.__INCLUDE_SERVLET_PATH);
      pathInfo = (String) request.getAttribute(Dispatcher.__INCLUDE_PATH_INFO);
      if (servletPath == null) {
        servletPath = request.getServletPath();
        pathInfo = request.getPathInfo();
      }
    } else {
      included = Boolean.FALSE;
      servletPath = request.getServletPath();
      pathInfo = request.getPathInfo();
    }

    String pathInContext = URIUtil.addPaths(servletPath, pathInfo);

    if (maybeServeWelcomeFile(pathInContext, included, request, response)) {
      return;
    }

    Resource resource = null;
    try {
      resource = getResource(pathInContext);

      if (resource != null && resource.isDirectory()) {
        if (included ||
            staticFileUtils.passConditionalHeaders(request, response, resource)) {
          response.sendError(HttpServletResponse.SC_FORBIDDEN);
        }
      } else {
        if (resource == null || !resource.exists()) {
          logger.warning("No file found for: " + pathInContext);
          response.sendError(HttpServletResponse.SC_NOT_FOUND);
        } else {
          boolean isStatic = appEngineWebXml.includesStatic(resourceRoot + pathInContext);
          boolean isResource = appEngineWebXml.includesResource(
              resourceRoot + pathInContext);
          boolean usesRuntime = webXml.matches(pathInContext);
          Boolean isWelcomeFile = (Boolean)
              request.getAttribute("com.google.appengine.tools.development.isWelcomeFile");
          if (isWelcomeFile == null) {
            isWelcomeFile = false;
          }
View Full Code Here

Examples of gluebooster.jee.servlet.WebXml

          BookUtils.createDiv(thisContextChapter,
              "This documentation was created on a server with the following context path: "
                  + servletContext.getContextPath());
          BoostedNode webxmlChapter = BookUtils.createChapter(
              thisContextChapter, "Web.xml");
          WebXml webXml = new WebXml(servletContext);
          webXml.fillDocumentation(
              DocumentationResourecesId.DOCUMENTATION_TECHNICAL,
              webxmlChapter,
              documentationStatus.getDocumentationContext());
        }
View Full Code Here

Examples of net.sourceforge.javautil.web.server.descriptor.impl.WebXml

   * Initialize the web.xml
   */
  protected void initializeWebXml () {
    if (this.webXml == null) {
      URL webXmlURL = this.resolver.getResource("WEB-INF/web.xml");
      this.webXml = webXmlURL == null ? new WebXml() : WebXml.getInstance(webXmlURL);
    }
  }
View Full Code Here

Examples of org.ajax4jsf.webapp.WebXml

    ImageIO.setUseCache(false);

  }

  public WebXml getWebXml(FacesContext context) {
    WebXml webXml = WebXml.getInstance(context);
    if (null == webXml) {
      throw new FacesException(
          "Resources framework is not initialised, check web.xml for Filter configuration");
    }
    return webXml;
View Full Code Here

Examples of org.ajax4jsf.webapp.WebXml

                + lifecycleClass, e);
      }
    } else {
      lifecycle = new ResourceLifecycle();
    }
    webXml = new WebXml();
    webXml.init(servletContext, filterConfig.getFilterName());
    if (log.isDebugEnabled()) {
      log.debug("Resources service initialized");
    }
  }
View Full Code Here

Examples of org.ajax4jsf.webapp.WebXml

    ImageIO.setUseCache(false);

  }

  public WebXml getWebXml(FacesContext context) {
    WebXml webXml = (WebXml) context.getExternalContext()
        .getApplicationMap().get(WebXml.CONTEXT_ATTRIBUTE);
    if (null == webXml) {
      throw new FacesException(
          "Resources framework is not initialised, check web.xml for Filter configuration");
    }
View Full Code Here

Examples of org.apache.cactus.integration.ant.deployment.WebXml

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile);
        WebXml webXml = destWar.getWebXml();
        assertNull("The web.xml should not have a version specified",
            webXml.getVersion());
        assertServletMapping(webXml,
            "org.apache.cactus.server.ServletTestRedirector",
            "/ServletRedirector");
        assertJspMapping(webXml, "/jspRedirector.jsp", "/JspRedirector");
        // As the deployment descriptor in the source WAR doesn't contain a
        // DOCTYPE, it is assumed to be a version 2.2 descriptor. Thus it
        // should not contain a definition of the filter test redirector.
        // Assert that.
        assertTrue("Filter test redirector should not have been defined",
            !webXml.getFilterNames().hasNext());
    }
View Full Code Here

Examples of org.apache.cactus.integration.ant.deployment.webapp.WebXml

    {
        executeTestTarget();

        File destFile = getProject().resolveFile("work/destfile.war");
        WarArchive destWar = new DefaultWarArchive(destFile);
        WebXml webXml = destWar.getWebXml();
        assertNull("The web.xml should not have a version specified",
            webXml.getVersion());
        assertServletMapping(webXml,
            "org.apache.cactus.server.ServletTestRedirector",
            "ServletRedirector",
            "/ServletRedirector");
        assertJspMapping(webXml, "/jspRedirector.jsp", "JspRedirector",
            "/JspRedirector");
        // As the deployment descriptor in the source WAR doesn't contain a
        // DOCTYPE, it is assumed to be a version 2.2 descriptor. Thus it
        // should not contain a definition of the filter test redirector.
        // Assert that.
        assertTrue("Filter test redirector should not have been defined",
            !webXml.getFilterNames().hasNext());
    }
View Full Code Here

Examples of org.apache.catalina.deploy.WebXml

     * where there is duplicate configuration, the most specific level wins. ie
     * an application's web.xml takes precedence over the host level or global
     * web.xml file.
     */
    protected void webConfig() {
        WebXml webXml = createWebXml();

        // Parse global web.xml if present
        InputSource globalWebXml = getGlobalWebXmlSource();
        if (globalWebXml == null) {
            // This is unusual enough to log
            log.info(sm.getString("contextConfig.defaultMissing"));
        } else {
            parseWebXml(globalWebXml, webXml, false);
        }

        // Parse host level web.xml if present
        // Additive apart from welcome pages
        webXml.setReplaceWelcomeFiles(true);
        InputSource hostWebXml = getHostWebXmlSource();
        parseWebXml(hostWebXml, webXml, false);
       
        // Parse context level web.xml
        webXml.setReplaceWelcomeFiles(true);
        InputSource contextWebXml = getContextWebXmlSource();
        parseWebXml(contextWebXml, webXml, false);
       
        // Assuming 0 is safe for what is required in this case
        double webXmlVersion = 0;
        if (webXml.getVersion() != null) {
            webXmlVersion = Double.parseDouble(webXml.getVersion());
        }
       
        if (webXmlVersion >= 3) {
            // Ordering is important here

            // Step 1. Identify all the JARs packaged with the application
            // If the JARs have a web-fragment.xml it will be parsed at this
            // point.
            Map<String,WebXml> fragments = processJarsForWebFragments();

            // Only need to process fragments and annotations if metadata is
            // not complete
            Set<WebXml> orderedFragments = null;
            if  (!webXml.isMetadataComplete()) {
                // Step 2. Order the fragments.
                orderedFragments = WebXml.orderWebFragments(webXml, fragments);
   
                // Step 3. Look for ServletContainerInitializer implementations
                if (ok) {
                    processServletContainerInitializers(orderedFragments);
                }
   
                // Step 4. Process /WEB-INF/classes for annotations
                // This will add any matching classes to the typeInitializerMap
                if (ok) {
                    URL webinfClasses;
                    try {
                        webinfClasses = context.getServletContext().getResource(
                                "/WEB-INF/classes");
                        processAnnotationsUrl(webinfClasses, webXml);
                    } catch (MalformedURLException e) {
                        log.error(sm.getString(
                                "contextConfig.webinfClassesUrl"), e);
                    }
                }
   
                // Step 5. Process JARs for annotations - only need to process
                // those fragments we are going to use
                // This will add any matching classes to the typeInitializerMap
                if (ok) {
                    processAnnotations(orderedFragments);
                }
   
                // Step 6. Merge web-fragment.xml files into the main web.xml
                // file.
                if (ok) {
                    ok = webXml.merge(orderedFragments);
                }
   
                // Step 6.5 Convert explicitly mentioned jsps to servlets
                if (!false) {
                    convertJsps(webXml);
                }
   
                // Step 7. Apply merged web.xml to Context
                if (ok) {
                    webXml.configureContext(context);
   
                    // Step 7a. Make the merged web.xml available to other
                    // components, specifically Jasper, to save those components
                    // from having to re-generate it.
                    // TODO Use a ServletContainerInitializer for Jasper
                    String mergedWebXml = webXml.toXml();
                    context.getServletContext().setAttribute(
                           org.apache.tomcat.util.scan.Constants.MERGED_WEB_XML,
                            mergedWebXml);
                    if (context.getLogEffectiveWebXml()) {
                        log.info("web.xml:\n" + mergedWebXml);
                    }
                }
            } else {
                webXml.configureContext(context);
            }
           
            // Always need to look for static resources
            // Step 8. Look for static resources packaged in JARs
            if (ok) {
                // Spec does not define an order.
                // Use ordered JARs followed by remaining JARs
                Set<WebXml> resourceJars = new LinkedHashSet<WebXml>();
                if (orderedFragments != null) {
                    for (WebXml fragment : orderedFragments) {
                        resourceJars.add(fragment);
                    }
                }
                for (WebXml fragment : fragments.values()) {
                    if (!resourceJars.contains(fragment)) {
                        resourceJars.add(fragment);
                    }
                }
                processResourceJARs(resourceJars);
                // See also StandardContext.resourcesStart() for
                // WEB-INF/classes/META-INF/resources configuration
            }
           
            // Only look for ServletContainerInitializer if metadata is not
            // complete
            if (!webXml.isMetadataComplete()) {
                // Step 9. Apply the ServletContainerInitializer config to the
                // context
                if (ok) {
                    for (Map.Entry<ServletContainerInitializer,
                            Set<Class<?>>> entry :
                                initializerClassMap.entrySet()) {
                        if (entry.getValue().isEmpty()) {
                            context.addServletContainerInitializer(
                                    entry.getKey(), null);
                        } else {
                            context.addServletContainerInitializer(
                                    entry.getKey(), entry.getValue());
                        }
                    }
                }
            }
        } else {
            // Apply unmerged web.xml to Context
            convertJsps(webXml);
            webXml.configureContext(context);
        }
    }
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.