@Override public List<String> getFacesServletMappings() { 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()) { List<ServletDef> servlets = webXml.getServlets(); for (ServletDef servlet : servlets) { if ("javax.faces.webapp.FacesServlet".equals(servlet.getServletClass())) { List<ServletMappingDef> mappings = servlet.getMappings(); for (ServletMappingDef mapping : mappings) { results.addAll(mapping.getUrlPatterns()); } } } } else { if (webXml.getVersion().startsWith("3")) { results.add("*.jsf"); results.add("/faces/*"); } else ShellMessages.info( out, "FacesServlet not found in web.xml and Servlet " + "Version not >= 3.0, could not discover FacesServlet mappings"); } return results; }
@Override public List<String> getFaceletsViewMapping() { ServletFacet facet = project.getFacet(ServletFacet.class); WebAppDescriptor webXml = facet.getConfig(); return webXml.getFaceletsViewMappings(); }
@Override public FacesProjectStage getProjectStage() { ServletFacet facet = project.getFacet(ServletFacet.class); WebAppDescriptor config = facet.getConfig(); return config.getFacesProjectStage(); }
@Override public List<String> getFaceletsDefaultSuffixes() { ServletFacet facet = project.getFacet(ServletFacet.class); WebAppDescriptor webXml = facet.getConfig(); return webXml.getFaceletsDefaultSuffixes(); }