【发布时间】:2013-06-13 03:52:46
【问题描述】:
开始一个新项目,除了基本的东西,我还没有在项目中真正添加任何东西。我想做的第一件事是清理 .xhtml/.jsf 扩展。我安装了:
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>1.5</version>
</dependency>
制作目录:WEB-INF/faces-views/ 把简单的文件放在那里 home.xhtml 在我的 web.xml 我放:
<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>
我还尝试了没有上述上下文参数设置的 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
考虑到设置非常简单,我认为这将是一个很好的解决方案。有谁知道我可能面临的兼容性问题,或者我做错了什么。我在日志文件中看不到任何错误。
谢谢
【问题讨论】: