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
- How to add a catch block on Oracle BPEL - July 8, 2018
- How to Pass array of strings to a Field in Oracle BPEL - July 7, 2018
- Oracle BPEL For Each Activity Example - July 7, 2018