This is the structure of my project (exactly these five files):
/p1
pom.xml
/src
/main
/java
/webapp
a.html
b.xhtml
/WEB-INF
faces-config.xml
web.xml
I'm deploying this WAR to GlassFish and I can successfully access this URL: http://localhost:8080/p1/a.html
. When I'm trying to open http://localhost:8080/p1/b.xhtml
I'm getting a message
The requested resource (/p1/b.xhtml) is not available.
What am I doing wrong?
ps. My dependencies from pom.xml
:
...
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${jsf.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.facelets</groupId>
<artifactId>jsf-facelets</artifactId>
<version>${facelets.version}</version>
</dependency>
...
This is my web.xml
(core part of it):
<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>
My faces-config.xml
:
<application>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>