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

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


   @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

   @Command("project-stage")
   public void setProjectStage(@Option(name = "set") final FacesProjectStage stage, final PipeOut out)
   {
      ServletFacet srv = project.getFacet(ServletFacet.class);
      WebAppDescriptor config = srv.getConfig();
      if (stage == null)
      {
         ShellMessages.info(out, "Project stage is currently: " + config.getFacesProjectStage().getStage());
      }
      else
      {
         config.facesProjectStage(stage);
         srv.saveConfig(config);
         ShellMessages.success(out, "Faces PROJECT_STAGE updated to: " + stage.getStage());
      }
   }
View Full Code Here

   private Archive<?> handleArchive(WebArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      if(applicationArchive.contains(WEB_XML_PATH))
      {
         WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).from(
               applicationArchive.get(WEB_XML_PATH).getAsset().openStream());
        
         // SHRINKWRAP-187, to eager on not allowing overrides, delete it first
         applicationArchive.delete(WEB_XML_PATH);
         applicationArchive.setWebXML(
View Full Code Here

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

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

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

      // (prefer /faces/error.xhtml)

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

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

   private Archive<?> handleArchive(WebArchive applicationArchive, Collection<Archive<?>> auxiliaryArchives, WebArchive protocol, Processor processor)
   {
      if(applicationArchive.contains(WEB_XML_PATH))
      {
         WebAppDescriptor applicationWebXml = Descriptors.importAs(WebAppDescriptor.class).from(
               applicationArchive.get(WEB_XML_PATH).getAsset().openStream());
        
         // SHRINKWRAP-187, to eager on not allowing overrides, delete it first
         applicationArchive.delete(WEB_XML_PATH);
         applicationArchive.setWebXML(
View Full Code Here

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

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

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

      // (prefer /faces/error.xhtml)

      String errorLocation = getAccessStrategy().getWebPaths(web.getWebResource("error.xhtml")).get(1);
      servletConfig.errorPage(404, errorLocation);
      servletConfig.errorPage(500, errorLocation);
     
      // Use the server timezone since we accept dates in that timezone, and it makes sense to display them in the same
      if (servletConfig.getContextParam("javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE") == null)
      {
         servletConfig.contextParam("javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE", "true");
      }

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

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

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

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

      // (prefer /faces/error.xhtml)

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

      servlet.saveConfig(servletConfig);
   }
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.