jsf - xhtml 文件不起作用,但 html 文件可以正常工作
问题描述
我是 jsf 的新手,我正在尝试做一些基本的事情。当我运行 .xhtml 文件时,我收到 http 状态 404 错误,但如果我打开文件 ''index.html'' name 。它工作。但是我的 xhtml 文件不起作用。我用 web.xml 尝试了一些东西,但做不到。谁能有任何想法?怎么解决
<?xml version="1.0"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<display-name>GaziDortHaftax</display-name>
<welcome-file-list>
<welcome-file>demo.xhtml</welcome-file>
</welcome-file-list>
<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>
<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>
</web-app>
那是我的 web.xml
解决方案
推荐阅读
- sql - 优化 plpgsql 中函数使用的 PostgreSQL 查询(或寻找替代方案)
- scala - 使用 Spring Data JPA 在 Scala 中建模的最佳方法是什么
- c# - xamarin 形成 BLE 状态 unavilabe
- android - Android 无法从本机代码 JNI 调用 Java 方法
- php - 将平滑滚动与数据过滤器结合使用
- xamarin - 为 Xamarin Forms PCL 项目设置 CI/CD 的最佳方法是什么
- browser - 如何使用 ngx-translate 翻译服务检测 IE 11 中的语言变化
- swift - 后台模式 firebase 快速获取数据
- r - 数据帧的部分总和
- reactjs - react-intl:根据当前语言环境更改 div 方向