@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