I’ve been struggling with trying to get my commandButtons to perform an action (yet oddly, I have no problem pulling data from beans to include in my page). Have even posted up my code elsewhere and had it reviewed by others. So far, no luck. So, I’m thinking perhaps a different tact is in order. Can anyone point me to some very simple/basic sample code of a project that has a commandButton that is able to successfully call an action?
I’ve been struggling with trying to get my commandButtons to perform an action (yet
Share
A common cause among starters is that the
<h:form>is been forgotten. As per the HTML specification, any submit button which is intented to submit something to the server side should be placed inside a HTML<form>element.Here’s a simple Hello World how to do that in JSF:
JSF page
Bean:
That’s all 🙂
For other possible causes of this problem, check the 1st link in the list below.
See also:
h:commandLinkdoesn’t workSunOracle Java EE 6 tutorial