Murat Mustafin February 2016

IntelliJ project errors "/hello.xhtml Not Found in ExternalContext as a Resource"

My web.xml contains

<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. What am I doing wrong?

Answers


Murat Mustafin February 2016

The problem was that IntelliJ Idea configured non-existed folder as web resources. Project Structure -> Facets -> Web, then i changed web resources directory path ti actual web folder. That resolved the issue.

Post Status

Asked in February 2016
Viewed 2,879 times
Voted 12
Answered 1 times

Search




Leave an answer