yegor256
yegor256

Reputation: 105063

How to build a URL in the JSF page?

I'm trying to create a <a> tag in my Facelets XHTML page, but can't understand how to do it.. This is what I'm doing:

<h:outputLink value="static/faq.xhtml">FAQ</h:outputLink>

Am I using the right tag?

Upvotes: 1

Views: 1079

Answers (2)

BalusC
BalusC

Reputation: 1108722

This should work. Open page in webbrowser, rightclick and View Source to see the JSF-generated HTML output. You should see a <a> element being generated.

To learn what HTML the JSF components are rendering, head to the tag documentation. Here's a cite of relevance of the one for <h:outputLink>:

Render an HTML "a" anchor element. The value of the component is rendered as the value of the "href" attribute.

Upvotes: 1

Bozho
Bozho

Reputation: 597106

Simply use <a href="static/faq.xhtml">FAQ</a>.

Upvotes: 1

Related Questions