【发布时间】:2012-07-05 22:05:39
【问题描述】:
当我访问http://localhost:8080/CSPPortal/index.html 时尝试重定向到admin.xhtml 页面。根 index.html 包含
<html><head><meta http-equiv="Refresh" content="0; URL=pages/admin.jsf"/></head></html>
问题是 url 一直返回到 login.jsf 之前在 index.html 中声明。
尝试过:将一个空的index.jsf 页面添加到根文件夹。尝试将FacesServelet 映射到*.xhtml old answer on SO。尝试从 web.xml 中删除 <welcome-file-list>。 所有试验都失败了!!!! 任何关于哪里出了问题的建议都将非常感激。
这里是web.xml内容:
<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>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
faces-config.xml中的导航规则如下,因为我还没有admin.xhtml的链接:
<navigation-rule>
<from-view-id>/pages/login.xhtml</from-view-id>
<navigation-case>
<from-outcome>result</from-outcome>
<to-view-id>/pages/result.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
使用 JBoss AS 7.1、RichFaces 4.0、JSF 2.0(通过 JBoss 工具)
【问题讨论】:
标签: jsf redirect navigation richfaces