11

I'm getting this warning in my application

JSF1090: Navigation case not resolved for component j_idt51

What is the reason for this warning and how can I resolve it? The strange thing is that the component id j_idt51 is not in the rendered page. If I look to the HTML of the generated page there is no element with id j_idt51.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
simonC
  • 4,101
  • 10
  • 50
  • 78
  • The warning is even more annoying since our production Glassfish log does not show the `xhtml` site, markup where the error occurs and i cannot find it in development. – djmj Mar 13 '20 at 15:20

1 Answers1

13

This warning will occur whenever you use an (implicit) navigation outcome in the outcome attribute of <h:link> or <h:button>, which does not represent a valid view ID.

E.g.

<h:link ... outcome="viewIdWhichDoesNotExist" />
<h:button ... outcome="viewIdWhichDoesNotExist" />

Additionally, the <h:link> will render a <span> element instead of an <a> element.

The solution is obvious: use a valid view ID, or make at least sure that the desired view is resolveable by ConfigurableNavigationHandler#getNavigationCase().

Note that some starters use for an unknown reason even a full URL like http://google.com as outcome value of <h:link>:

<h:link value="Go to Google" outcome="http://google.com" />

This abuse would then also yield exactly this warning. You should be using <h:outputLink> or just <a> instead.

As to the absence of a HTML element with the same ID as the JSF component, this may happen when you didn't explicitly specify the JSF component's id attribute. The JSF component ID does then not necessarily end up in the generated HTML output. Assigning those components a fixed ID should help better in nailing down the cause.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Excelent es allways ... I had a h:link in my code that was obsolete. – simonC Dec 11 '13 at 13:19
  • Yup, my `` "outcome" attribute was pointed at a file that didn't exist in the filesystem. As soon as I put the file there, my link worked and the error went away Thanks @BalusC – fusion27 Oct 28 '14 at 13:40
  • JSF should provide a single link component with support for all properties like `href, outcome, action, value` and rendering depending on what is provided. This would be more user / developer orientated then the current technical approach. – djmj Mar 13 '20 at 15:16