@Override
public void install(Project project)
{
if (!installedInWebXML(project))
{
ServletFacet_3_0 servlet = project.getFacet(ServletFacet_3_0.class);
WebAppDescriptor config = servlet.getConfig();
config.createServlet().servletName(JAXRS_SERVLET).loadOnStartup(1);
String urlPattern = path;
if (urlPattern.endsWith("/"))
{
urlPattern = urlPattern.substring(0, urlPattern.length() - 1);
}
config.createServletMapping().servletName(JAXRS_SERVLET).urlPattern(urlPattern);
servlet.saveConfig(config);
}
}