Displaying errors by the field for array objects

Prasanth <[email protected]>
Newsgroups gmane.comp.jakarta.struts.user
Message-ID <[email protected]>
Hi,

I have text fields with names as amount[0], amount[1] etc which are loaded in a map in the action class. Trying to display error messages next to each field rather than showing all at the top using 
the code below but it is not working. If I just use fielderror tag then I can display all errors at the top of the jsp, but would like to display the error messages next to each field.  What is the 
right way to accomplish this?

When adding field errors adding the error as below.
addFieldError("amount["+ rowNumber + "]", getText("error.enter.amount"));

Then trying to display the error in the jsp using the below tag. loop is the status var for s:iterator.
<s:fielderror  fieldName="amount[%{#loop.index}]"/>

Below tag is displaying all field errors as if I am using <s:fielderror/>
<s:fielderror > <param value="amount[%{#loop.index}]"/> </s:fielderror>

Thanks,
Prasanth
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.