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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With