JSF OutputLink Example
The JSF h:OutputLink in useful to navigate a page outside of the Web application. The outcome attribute needs complete Web page name or the URL; For example, ‘Home.xhtml’ and not accept viewID like ‘Home’.
JSF Outputlink renders an anchor tag in the browser like below
JSF => <h:outputLink value=”www.google.com”>Google</h:outputLink>
HTML => <a href=”http://www.google.com” target=”_blank”>Google</a>
JSF h:Outputlink Example
Below is the index.xhtml page contains two h:outputlink tag. First one navigates outside of the application and second one navigate to Home.xhtml page. If I not mentioned the http in the first URL then JSF will append the URL at the end of the application URL .
<h:outputLink value="http://www.google.com" target="_blank" >Google</h:outputLink>
It renders in the browser like below.
Download the Source Code:
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- Is it possible to logout Primavera P6 through SQL Query? - February 16, 2018
- How to Create Primavera P6 EPPM Database schemas in Microsoft SQL Server - February 15, 2018
- Configure Windows Firewall for Microsoft SQL Server 2017 – Part 4 - February 14, 2018