JBoss Community Archive (Read Only)

Portlet Bridge 3.0

Linking and Redirects

Linking to Facelets page within same Portlet

When linking to any Facelets page within your portlet web application, you may use the following:

<h:outputLink value="#{facesContext.externalContext.requestContextPath}/home.xhtml">
  <f:param name="javax.portlet.faces.ViewLink" value="true"/>
    navigate to the test page
  </h:outputLink>

Redirect to External Page or Resource

To link to a non JSF View (such as jboss.org), you may use the following:

<h:commandLink actionListener="#{yourBean.yourListener}">
  <f:param name="javax.portlet.faces.DirectLink" value="true"/>
    navigate to the test page
</h:commandLink>

With a backing Bean that has the following:

public class YourBean {
  public void yourListener() {
    FacesContext.getCurrentInstance().getExternalContext().redirect("http://www.jboss.org");
  }
}
JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:26:01 UTC, last content change 2012-07-31 17:47:57 UTC.