You can't use navigation cases for this. Use h:outputLink
with a direct URL.
<h:outputLink value="http://google.com">Click</h:outputLink>
Or just plain vanilla HTML.
<a href="http://google.com">Click</a>
Update:
A <h:commandButton>
is also doable, but then you have to add a bean action method which does ExternalContext#redirect()
to the desired URL.
public void submit() {
FacesContext.getCurrentInstance().getExternalContext().redirect("http://google.com");
}
An alternative is indeed to style the link to make it look like a button. Here's a kickoff example:
a.button {
display: inline-block;
background: lightgray;
border: 2px outset lightgray;
cursor: default;
}
a.button:active {
border-style: inset;
}
Use it as <h:outputLink styleClass="button">
or <a class="button">
.