jsf中使用模板的tomcat欢迎页面
我有一个jsf项目 我的页面都引用了template.xhtml 目前我在web.xml中有以下内容jsf中使用模板的tomcat欢迎页面,jsf,tomcat,web.xml,Jsf,Tomcat,Web.xml,我有一个jsf项目 我的页面都引用了template.xhtml 目前我在web.xml中有以下内容 <welcome-file-list> <welcome-file>/pages/home/index.xhtml</welcome-file> </welcome-file-list> <welcome-file-list> <welcome-file>index.html</welcome-fil
<welcome-file-list>
<welcome-file>/pages/home/index.xhtml</welcome-file>
</welcome-file-list>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
/pages/home/index.xhtml
当我现在尝试访问根目录时,它会将该页面中的一些内容显示为jsf代码(未呈现),但模板中的所有内容也消失了。它只显示标题和两行代码
感谢所有帮助检查
web.xml
文件中Facesservlet的url映射,可能是错误的
一个好的应该像一个在:
小脸蛋
javax.faces.webapp.FacesServlet
小脸蛋
*.xhtml
解决了它
在web.xml中添加了以下内容
<welcome-file-list>
<welcome-file>/pages/home/index.xhtml</welcome-file>
</welcome-file-list>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
index.html
并创建了以下index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="refresh" content="0; faces/pages/home/index.xhtml">
<title>Insert title here</title>
</head>
<body>
</body>
</html>
在此处插入标题
提供更多详细信息:至少包括整个web.xml、主模板和模板客户端。如果模板中引用的页面未映射到faces servlet,则可能是正确的。