更新时间:2023-11-17 23:05:04
您犯了2个错误.
/WEB-INF
文件夹用于配置文件,包括文件,模板文件,标记文件等,这些文件应被隐藏以防止直接访问,而不是可公开访问的文件.将可公开访问的文件放在/WEB-INF
文件夹之外.
/WEB-INF
folder is for configuration files, include files, template files, tag files, etc, which are supposed to be hidden from direct access, not for publicly accessible files. Put publicly accessible files outside /WEB-INF
folder.
/faces
文件夹. FacesServlet
上的虚拟/faces/*
URL模式并不意味着您应该具有这样的物理文件夹.删除它.
/faces
folder should not be used at all. A virtual /faces/*
URL pattern on FacesServlet
doesn't imply that you should have a physical folder like that. Remove it.
所以,所有一切都只是
WebContent
|-- META-INF
|-- WEB-INF
| |-- faces-config.xml
| `-- web.xml
`-- login.xhtml
和
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
和
http://localhost:8080/clientAccountManager/login.xhtml
应该做.