简体   繁体   English

IntelliJ项目错误“在外部上下文中找不到/hello.xhtml作为资源”

[英]IntelliJ project errors “/hello.xhtml Not Found in ExternalContext as a Resource”

My web.xml contains 我的web.xml包含

<welcome-file-list>
    <welcome-file>faces/hello.xhtml</welcome-file>
</welcome-file-list>
<!-- JSF mapping -->
<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>/faces/*</url-pattern>
</servlet-mapping>
<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>*.xhtml</url-pattern>
</servlet-mapping>

Directory structure is 目录结构是

-web
---WEB-INF
     faces-config.xml
     web.xml
---hello.xhtml

I know that there are many questions like this on stackoverflow but they didn't help me. 我知道在stackoverflow上有很多这样的问题,但它们并没有帮助我。 What am I doing wrong? 我究竟做错了什么?

The problem was that IntelliJ Idea configured non-existed folder as web resources. 问题是IntelliJ Idea将不存在的文件夹配置为Web资源。 Project Structure -> Facets -> Web, then i changed web resources directory path ti actual web folder. 项目结构->构面-> Web,然后我更改了Web资源目录路径到实际的Web文件夹。 That resolved the issue. 那解决了问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:在ExternalContext中找不到/login.xhtml作为资源 - Error: /login.xhtml Not Found in ExternalContext as a Resource 404 /index.xhtml在ExternalContext中找不到作为资源 - 404 /index.xhtml Not Found in ExternalContext as a Resource 在ExternalContext中找不到/index.xhtml作为资源 - /index.xhtml Not Found in ExternalContext as a Resource welcome-file index.xhtml提供“在ExternalContext中找不到”作为资源 - welcome-file index.xhtml gives Not Found in ExternalContext as a Resource 错误:在ExternalContext中找不到/JavaServerFaces/default.xhtml作为资源 - Error: /JavaServerFaces/default.xhtml Not Found in ExternalContext as a Resource com.sun.faces.context.FacesFileNotFoundException:/protected-area/index.xhtml在ExternalContext中找不到作为资源 - com.sun.faces.context.FacesFileNotFoundException: /protected-area/index.xhtml Not Found in ExternalContext as a Resource JSF:/WEB-INF/*/javax.faces.resource/theme.xhtml在ExternalContext中找不到作为资源(Primeface的资源URI有星号) - JSF: /WEB-INF/*/javax.faces.resource/theme.xhtml Not Found in ExternalContext as a Resource (Primeface's resource URI has asterisk sign) 如何使用IntelliJ验证XHTML页面上的JSF错误? - How to validate JSF errors on XHTML pages with IntelliJ? 在JSF中找不到index.xhtml资源 - index.xhtml resource not found in JSF 在 ExternalContext 中找不到作为资源错误(Amazon Elastic Beanstalk / Spring Boot / JSF + Primefaces) - Not Found in ExternalContext as a Resource Error (Amazon Elastic Beanstalk / Spring Boot / JSF + Primefaces)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM