5

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?

Pali
  • 1,337
  • 1
  • 14
  • 40

1 Answers1

9

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.

Bonifacio
  • 1,482
  • 10
  • 19