JSF action against result attribute

I am new to JSF and trying to understand what is the difference between an action and result attributes? This is not the difference between buttons and commands, but between the attributes of the result and the action on the tag is the same .

For example, I can have:

<h:button value="Go" outcome="<value>" />

or

<h:button value="Go" action="<value>" />

I'm not sure when to use which one. In addition, if the value is set <value> <#{bean.methodThatReturnsStringInNavigationRule}>, or <string literal in navigation rule>?

Thank.

+5
source share
2 answers

, , , , . JSF , :

  • <h:button outcome="user-management"> . , .
  • <h:commandButton action="#{backingBean.goToUserManagement}" " " , , , . h:form.

<h:button outcome="user-management"> <h:button outcome="#{backingBean.userManagementNavigationResult}">, getter "user-management".

+10

API JSF 2.0, <h:button> action. <h:button> - JSF 2.0. outcome, bean, , <h:commandButton>.

JavaScript , , "h: button" "onclick" window.location.href.

<h:button value="buton" outcome="login" />          

// HTML

<input type="button" 
       onclick="window.location.href='/ContextRoot/faces/login.xhtml; return false;" 
       value="buton" />

: mkyong. , .

JSF: BalusC. :).

+3

All Articles