JSF – Add OmniFaces to your project

1. In pom.xml


<dependency>
            <groupId>org.omnifaces</groupId>
            <artifactId>omnifaces</artifactId>
            <version>2.0</version>
 </dependency>

2. You should put your xhtml pages under:

src/main/webapp/WEB-INF/faces-views

3. In your bean for example. Here strange is a xhtml file under the folder stated in point 2:

 ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
 ec.redirect(ec.getRequestContextPath() + "strange");