gpt4 book ai didi

java - 未呈现 JSF 标记

转载 作者:搜寻专家 更新时间:2023-10-31 08:09:30 29 4
gpt4 key购买 nike

<分区>

我是 JSF 的新手,但我的 JSF 标签没有呈现在 xhtml 文件中,我尝试了所有可能的解决方案,但问题没有解决

我的 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>JSFProject</display-name>
<welcome-file-list>
<welcome-file>JSFProject/index.html</welcome-file>
<welcome-file>JSFProject/index.htm</welcome-file>
<welcome-file>JSFProject/index.jsp</welcome-file>
<welcome-file>JSFProject/default.html</welcome-file>
<welcome-file>JSFProject/default.htm</welcome-file>
<welcome-file>JSFProject/default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>

<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>*.xhtml</url-pattern>
</servlet-mapping>
</web-app>

我的例子.xhtml

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Example</title>
</head>
<body>
<h:form>
Some random data: <h:inputText/><br/> <!-- Textfield ignored -->
Some other data: <h:inputText/><br/> <!-- Textfield ignored -->

</h:form>

</body>
</html>

我花了 3 天时间来解决问题,欢迎任何帮助

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com