Description
<h:form id="form1">
<h:inputText value="#
" id="selectedDate"/>
<h:commandButton actionListener="#
" id="Button1" value="Query"/>
</h:form>
<h:form id="form2">
<h:dataTable var="item" value="#
"/>
<h:commandButton actionListener="#
" id="Button2" value="Create"/>
<s:token/>
<h:form>
Button1 do query, get a result(10 rows max), then user can select rows in the dataTable, then click "create " to submit.
form2 contains token component, the first time it works OK, but the Next time it will get failed(because the token value has not changed).
Can I reset token value in a view controller in a action listener(or submit ) method?
my solution:
wirte a backing bean contains token component, and remove its token value attribute to let it generate new token value