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");
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s