Package org.jboss.shrinkwrap.descriptor.api.spec.servlet.web

Examples of org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor


      ServletFacet servlet = this.project.getFacet(ServletFacet.class);

      Node webXML = removeConflictingErrorPages(servlet);
      servlet.getConfigFile().setContents(XMLParser.toXMLInputStream(webXML));

      WebAppDescriptor config = servlet.getConfig();
      WebResourceFacet web = this.project.getFacet(WebResourceFacet.class);

      // (prefer /faces/error.xhtml)

      String errorLocation = getAccessStrategy().getWebPaths(web.getWebResource("error.xhtml")).get(1);
      config.errorPage(404, errorLocation);
      config.errorPage(500, errorLocation);

      servlet.saveConfig(config);
   }
View Full Code Here


      DescriptorImporter<WebAppDescriptor> importer = Descriptors.importAs(WebAppDescriptor.class);
      FileResource<?> configFile = getConfigFile();
      InputStream inputStream = configFile.getResourceInputStream();
      try
      {
         WebAppDescriptor descriptor = importer.from(inputStream);
         return descriptor;
      }
      finally
      {
         Streams.closeQuietly(inputStream);
View Full Code Here

            public InputStream getResourceInputStream()
            {
               if (!exists())
               {
                  String projectName = project.getFacet(MetadataFacet.class).getProjectName();
                  WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                           .displayName(projectName)
                           .sessionTimeout(30);
                  return Streams.fromString(unit.exportAsString());
               }
               else
               {
                  return super.getResourceInputStream();
               }
View Full Code Here

            public InputStream getResourceInputStream()
            {
               if (!exists())
               {
                  String projectName = project.getFacet(MetadataFacet.class).getProjectName();
                  WebAppDescriptor unit = Descriptors.create(WebAppDescriptor.class)
                           .displayName(projectName)
                           .sessionTimeout(30);
                  return Streams.fromString(unit.exportAsString());
               }
               else
               {
                  return super.getResourceInputStream();
               }
View Full Code Here

   @Override
   public FacesProjectStage getProjectStage()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor config = facet.getConfig();
      return config.getFacesProjectStage();
   }
View Full Code Here

   @Override
   public List<String> getFacesServletMappings()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return getExplicitFacesServletMappings(webXml);
   }
View Full Code Here

   @Override
   public List<String> getEffectiveFacesServletMappings()
   {
      List<String> results = new ArrayList<String>();
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();

      // TODO should probably take into account facelets view mappings
      // facelets.VIEW_MAPPINGS

      if (webXml.hasFacesServlet())
      {
         results.addAll(getExplicitFacesServletMappings(webXml));
      }
      else
      {
         if (webXml.getVersion().startsWith("3"))
         {
            results.add("*.jsf");
            results.add("/faces/*");
         }
         else
View Full Code Here

   @Override
   public List<String> getFacesDefaultSuffixes()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return webXml.getFacesDefaultSuffixes();
   }
View Full Code Here

   @Override
   public List<String> getFaceletsDefaultSuffixes()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return webXml.getFaceletsDefaultSuffixes();
   }
View Full Code Here

   @Override
   public List<String> getFaceletsViewMapping()
   {
      ServletFacet facet = project.getFacet(ServletFacet.class);
      WebAppDescriptor webXml = facet.getConfig();
      return webXml.getFaceletsViewMappings();
   }
View Full Code Here

TOP

Related Classes of org.jboss.shrinkwrap.descriptor.api.spec.servlet.web.WebAppDescriptor

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.