Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF h:link becomes span [duplicate]

Tags:

jsf

Why does this JSF Tag

<h:link outcome="hello/sayhi">Spring MVC</h:link>
<h:outputLink value="hello/sayhi" >Spring MVC</h:outputLink>

becomes

<span>Spring MVC</span>
<a href="hello/sayhi">Spring MVC</a>

in the browser so that the <span> is completely useless?

How can I get h:link working so it outputs the correct link including the context path?

like image 641
Pali Avatar asked Feb 05 '23 10:02

Pali


1 Answers

The component h:link requires a valid (and existent) outcome target, if for any reason the server do not find the outcome target in your project, then a span will be rendered.

In this case, review your application files and check if the target "hello/sayhi" really exists and is declared correctly. Maybe you are just forgetting a bar ("/hello/sayhi") before the path (it's impossible for us to know).

According to it's documentation, an h:link should only render as a span if you set it as disabled=true. So I'm 100% sure that your problem really is a incorrect navigation path.

like image 88
Bonifacio Avatar answered Feb 12 '23 08:02

Bonifacio