我在META-INF/下的jar文件中有以下web-fragment.xml
似乎我不能让它工作(尽管我认为它在以前的测试中是有效的)。
同样的内容也适用于web.xml。
web应用程序本身就是ear的一部分,但我不认为这有什么关系。
我尝试使用tag和。顺便说一句,参考文档在哪里?
我们的想法是将我的jar包含在所有ear的wars (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>发布于 2011-03-22 23:51:36
好吧,我在上面花了一些时间,但它很简单。
我使用Netbeans,并希望它能将CommonWeb.jar放入WAR的WEB-INF/lib中。它没有。我不知道为什么它对一些库有效,而对其他库无效。
无论如何,我只是取消选中了我的WAR项目属性的lib目录下的"package“,并在项目properties / packaging中为相同的jar添加了一个条目,指定WEB-INF/lib作为路径。一些经典的东西,我并不太自豪,因为我不得不要求这样的东西;-)
发布于 2011-03-22 18:40:26
尝试将"web-app“标签替换为"web-fragment”
https://stackoverflow.com/questions/5389857
复制相似问题