Frage

I have already check the similar questions on so but I don't have anything matching.

I check if I have errors with:

result.getErrorCount() != 0)

and inside I have the list of errors using

List<ObjectError> ae = result.getAllErrors();

when I use the debug mode of eclipse and I check the field inside the list I have the good id in the form. But at runtime I'm unable to get the value by doing

for (ObjectError fe : result.getAllErrors())
{
   fe.getField();           
}
War es hilfreich?

Lösung

You need to cast ObjectError to FieldError and then you can retrieve the name of the affected field by calling getField().

JavaDoc for FieldError

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top