On 31-03-09 16:15, Henrik Brautaset Aronsen wrote:
On 31-03-09 15:12, Henrik Brautaset Aronsen wrote:
The form validation error messages are missing after I upgraded from 2.0.11 to 2.1.6, and I can't figure out why. When I submit an invalid form, the form just comes back without the visible error messages.
...
The jsp:
...
<s:form action="MySupport" cssClass="settings">
<table>
<s:textfield label="Category " name="form.supportCategory" />
        ...
<input type="submit" value="Send e-mail"/>
</table>
</s:form>

I've done some more digging: I can see the error messages by using <s:fielderror/> [1], but why aren't they automatically attached to the <s:textfield> like they were in Struts 2.0.x?

.. and some more digging. We have our own controlfooter.tpl, and the fieldErrors should have been rendered there (TEST1 is shown, TEST2 is not):

</td>
<td>TEST1
<#if hasFieldErrors>TEST2
<#list fieldErrors[parameters.name] as error>
<div<#rt/>
<#if parameters.id?exists>
            errorFor="${parameters.id}"<#rt/>
</#if>
          class="errorMessage">
            ${error?html}
</div><#t/>
</#list>
</#if>
</td>
</tr>

hasFieldErrors is never true, even though they should have been (because <s:fielderror/> certainly show errors. I've even inserted the hasFieldErrors assignment from the struts2-core jar, but it didn't help:

<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>

Still talking to myself,
Henrik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to