Reputation: 5320
On Open Liberty 21.0.0.6., instead of presenting my welcome JSF page, my browser returns empty content when I point it to http://<host>:<port>/<ctxRoot>
,
<web-app id="WebApp_ID" version="4.0"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd">
<display-name>MyJSF</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
and a feature set of:
<server>
<featureManager>
<feature>jaxrs-2.1</feature>
<feature>cdi-2.0</feature>
<feature>jpa-2.2</feature>
<feature>jdbc-4.3</feature>
<feature>jsf-2.3</feature>
<feature>mpHealth-3.0</feature>
</featureManager>
I also have some other stuff in my app like JPA and JAX-RS.
Upvotes: 2
Views: 343
Reputation: 5320
In my case the problem is that I had a JAX-RS Application configured to use: @ApplicationPath("/")
which was colliding with my goal of having the "/" application path serve up the welcome-file.
Move the JAX-RS app to its own path within the WAR, e.g:
import javax.ws.rs.core.Application;
@ApplicationPath("/api")
public class TestApp extends Application { }
This was easy to stumble into by taking an existing simple JAX-RS app using "/" as the app path, and then adding JSF to it. Then I thought I was having trouble with the JSF implementation.
Upvotes: 3