开始一个新项目,除了基本的东西,我还没有在项目中真正添加任何东西。我想做的第一件事是清理 .xhtml/.jsf 扩展。我安装了:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.5</version>
</dependency>
制作目录:WEB-INF/faces-views/ 在我的 web.xml 中的 home.xhtml 中放入简单文件 我放入:
<context-param>
<param-name>org.omnifaces.FACES_VIEWS_SCAN_PATHS</param-name>
<param-value>/*.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>home</welcome-file>
</welcome-file-list>
我还尝试了没有上述 context-param 设置的 web.xml。
(仅供参考:同一页面在host/context/home.xhtml的omnifaces之外工作)
在日志中,我可以看到全脸正在加载:
23:22:24,628 INFO [org.omnifaces.eventlistener.VersionLoggerEventListener] (ServerService Thread Pool -- 74) Using OmniFaces version 1.5
但是,当我转到 localhost:8080/{context}/home 时,我得到一个 404:
JBWEB000309: type JBWEB000067: Status report
JBWEB000068: message /{context}/home.xhtml
JBWEB000069: description JBWEB000124: The requested resource is not available.
容器是 JBoss 社区最新的:Janus:6.1.0.GA, JBoss Web/7.2.0.Final-redhat-1
考虑到设置非常简单,我认为这将是一个很好的解决方案。有谁知道我可能面临的兼容性问题,或者我做错了什么。我在日志文件中看不到任何错误。
谢谢