<f:metadata>
<f:viewParam name="token" value="#{authenticator.token}" />
<f:viewAction action="#{authenticator.check}" />
</f:metadata>
@ManagedBean
@RequestScoped
public class Authenticator {
private String token;
public String check() {
return isValid(token) ? null : "main.jsf";
}
// Getter/setter.
}