Hello,
I am playin with
struts 2.1.8 + tiles and trying out client side validation and running in a strange issue with required
string validation, regardless of whether or not a value is put in the text field, after clicking submit, struts always display the error message from action-validation.xml and the text field value clears out. When value is put in the text field, I would expect submit to take it the execute() of dosubmit class. For actions without validation everything works as expected. I think I am missing something very basic. Code snippets -
struts.xml -
<action name="dosubmit" class="com.group.dosubmit">
<result name="success" type="tiles">successpageDef</result>
<result name="input" type="tiles">inputpageDef</result>
</action>
inputpageDef body -
s:form action="dosubmit" method="post" validate="true" >
<div>
<s:textfield name="first" key="first" label="First" size="15" />
<s:submit value="Submit"/>
</div>
</s:form>
dosubmit-validation.xml -
<validators>
<field name="first">
<field-validator type="requiredstring">
<param name="trim">true</param>
<message>First is required</message>
</field-validator>
</field>
</validators>
Any help/pointers is appreciated.
thanks,
Peter