h:outputLink |
|
The outputLink tag renders an HTML anchor tag with an "href"
attribute.
The display value of the link can also be obtained from a
message bundle to support internationalization (I18N). This tag facilitates the
construction of HTML hyperlinks by allowing you to nest param tags to construct
querystring arguments. You can place outputText or graphicImage tags, for
example, within the outputLink tag to set the hyperlink text or image
value.
JSF Example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head />
<body>
<h:outputLink id="link1" value="http://www.mycompany.com">
<f:param name="projectId" value="123" />
<f:param name="userId" value="45" />
<h:outputText value="Open Project" />
</h:outputLink>
</body>
</html>
This example was formatted by JSFToolbox for Dreamweaver.
Rendered Output
HTML Output
<a href="http://www.mycompany.com?projectId=123&userId=45">Open Project</a>
|