我有以下/ WEB-fragment.xml之在一个jar文件,在META-INF如何让网络fragment.xml之工作
我似乎无法得到它的工作(虽然我认为这在以前没有测试)。
相同的内容在web.xml中起作用。
Web应用程序本身就是一个耳朵的一部分,但我不希望那么重要。
我尝试了< web-app>标记和< web-fragment>。在哪里参考文件,顺便说一句?
这个想法是将我的jar包括在我耳朵的所有战争(10+)中,以便在一个地方实现共同的东西(认证,...)。现在的问题是关于web-fragment,一旦我可以迁移到web-fragment,我就会得到一些工作(web.xml中就是这种情况)。
标签本身在2.5之前,将其更改为3.0(并清理项目以确保)。
<?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>
正如我所说,我试过,没有任何运气。此外,这样做时,它不再验证(和netbeans有内部例外),这是可疑的:我使用了一个错误的模式? – ymajoros 2011-03-22 10:46:20
(已编辑的问题,标签名称未显示) – ymajoros 2011-03-22 15:11:48