What's the difference between p:menuitem's url and outcome attributes?

919 Views Asked by At

According to the Primefaces 6.2 user guide the attributes stand for

Name | Default | Type | Description

[...]

url | null | String | Url to be navigated when menuitem is clicked

[...]

outcome | null | String | Navigation case outcome

where "outcome" is a synonym of the description for url. I would like to avoid using them wrongly.

1

There are 1 best solutions below

3
On

The answer is :

  • outcome refers to a JSF page in your application or a navigation rule defined in your faces-config.xml
  • url simply opens the given address, which could be on another website.

Using outcome is a great feature, because if the targeted JSF page does not exist, the link is not produced, so you will not have a 404 response when clicking on it.