I have the following web-fragment.xml file in the jar file, under META-INF /
I can't seem to get it to work (although I think it was in previous tests).
The same content works in web.xml.
The web application itself is part of the ear, but I would not expect it to make a difference.
I tried using the <web-app> tag and <web fragment>. Where is the help documentation, btw?
The idea is to include my can in all my ear wars (10+) in order to have common things implemented in one place (authentication, ...). A question about the web fragment, I will get everything that works (which was the case with web.xml) as soon as I can switch to this.
Tagwas itself in 2.5 before, changed it to 3.0 (and cleared the project to make sure).
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<context-param>
<param-name>javax.faces.FACELETS_RESOURCE_RESOLVER</param-name>
<param-value>be.epc.common.web.util.EpcResourceResolver</param-value>
</context-param>
<error-page>
<error-code>403</error-code>
<location>/epcResources/noaccess.jsf</location>
</error-page>
<error-page>
<exception-type>javax.ejb.AccessLocalException</exception-type>
<location>/epcResources/noaccess.jsf</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/epcResources/notfound.jsf</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/epcResources/error.jsf</location>
</error-page>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<url-pattern>/icefaces/*</url-pattern>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<security-constraint>
<web-resource-collection>
<web-resource-name>Toutes pages</web-resource-name>
<description/>
<url-pattern>*.xhtml</url-pattern>
<url-pattern>*.jsf</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>APP_EPC</role-name>
</auth-constraint>
<user-data-constraint>
<description>HTTPS</description>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>epcRealm</realm-name>
<form-login-config>
<form-login-page>/unauthenticated-redirect.jsp</form-login-page>
<form-error-page>/unauthenticated-redirect.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description/>
<role-name>APP_EPC</role-name>
</security-role>
</web-app>