Hello Community,

I'm quite new to Struts2 (or even Struts anyhow) and I'm struggling with a Problem .

My multiline Form send's via the validation the fieldError data as shown below to my jsp. Because I do have a multiline form my return of the Object key is something like: myrecords[3].myfieldName. This information is not the best for my Users so I want to break it up in something like : At row 4 (because it starts counting 0) in Column MyFieldName is Error blablabla... Therefor I need to extract the index and the Fieldname. Well the problem is the index. As you can see in my example below I have extracted the index (in my example 3 ) from the Object key. And that works pretty fine. But, and now comes my Problem, it's still a String and I can't add the int 1 to it. I have tried several things in different combinations but nothing worked out.

<s:iterator value="fieldErrors" >
        <s:set name="r2" 
value="%{key.substring(key.indexOf('[')+1,key.indexOf(']'))}"/>
        <s:set name="r3" value="%{#r2.trim()}"/>  //howto convert r3 to a 
integer?
        <s:property value="r3"/><br>
</s:iterator>

Thanks for any help

Uwe






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

Reply via email to