I faced a interesting problem here. When I click commandButton, it calls wrong action method even button has not action attribute. What is this?
Asked
Active
Viewed 452 times
1 Answers
0
That may happen when the EL expression which you intented to use as a method expression is been evaluated as a value expression.
For example, when you have outcommented it using a HTML comment while not having configured Facelets to skip comments.
<!-- <h:commandButton value="submit" action="#{bean.submit()}" /> -->
The HTML comments namely doesn't stop EL expressions like #{bean.submit()}
from being evaluated. It will ultimately generate HTML output with the return value of #{bean.submit()}
inlined in the action
attribute.
To naildown the root cause in your case, you should be creating and providing a fullworthy SSCCE.