更新时间:2023-12-04 21:02:52
您在部署中缺少faces-config.xml
. Java EE 6规范要求WEB-INF
目录中存在faces-config.xml
描述符,以触发JSF.
You are missing the faces-config.xml
in your Deployment. The Java EE 6 specification requires a faces-config.xml
descriptor to be present in your WEB-INF
-directory to trigger JSF.
与已经包含faces-config.xml
描述符的beans.xml
不同,该文件不能为空文件.它必须至少包含根节点和version属性,以指定使用中的JSF版本.
Unlike beans.xml
which you already included the faces-config.xml
descriptor cannot be an empty file. It must contain at least the root node and the version attribute to specify the JSF version in use.
因此,您需要将以下代码添加到ShrinkWrap构建器中:
So you need to add the following code to your ShrinkWrap builder:
.addAsWebInfResource(new StringAsset("<faces-config version=\"2.0\"/>"), "faces-config.xml");