You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Barun Kumar Yadav <by...@sapient.com> on 2006/10/12 12:09:49 UTC
Indexed Properties in Struts
Hi
I'm using Indexed Properties with Struts and am attempting to over-ride the getter method of a List while trying to retrieve data.
I have an example where I use the <bean:write> tag to retrieve contents of a List
<jsp:useBean id="bean" class="org.apache.struts.webapp.exercise.StringBean"/>
<bean:write name="bean" property="stringIndexed[1]"/>
And this code effectively calls the Getter function shown below
public Object getStringIndexed(int index) {
return strAry.get(index);
}
And correct values are retrieved.
However, when I try to use a similar concept using the <html:text> tag,
<html:text property='<%= "rooms["+rn.intValue()+"].childAge["+can.intValue()+"]" %>'/>
The getter function public Object getChildAge(int index) does not get control
Has anyone encountered similar problems or does anyone know the reason for this ?
Help will be highly appreciated
Thanks
Barun Kumar Yadav
¬Sapient Bangalore
Work 91.804.104.7490
Mobile 91.989.197.4493
YIM meet_you_23
Re: Indexed Properties in Struts
Posted by Aftab Vhora <af...@oracle.com>.
Hi Yadav,
have a look at below link u'll find something of ur intrest ...
http://www.developer.com/java/ejb/article.php/2233591
http://www.developer.com/java/ejb/article.php/10931_3321521_1
Thanks & Regards,
Aftab Vhora
Barun Kumar Yadav wrote:
>Hi
>I'm using Indexed Properties with Struts and am attempting to over-ride the getter method of a List while trying to retrieve data.
>I have an example where I use the <bean:write> tag to retrieve contents of a List
><jsp:useBean id="bean" class="org.apache.struts.webapp.exercise.StringBean"/>
><bean:write name="bean" property="stringIndexed[1]"/>
>And this code effectively calls the Getter function shown below
>public Object getStringIndexed(int index) {
>return strAry.get(index);
>}
>And correct values are retrieved.
>However, when I try to use a similar concept using the <html:text> tag,
><html:text property='<%= "rooms["+rn.intValue()+"].childAge["+can.intValue()+"]" %>'/>
>The getter function public Object getChildAge(int index) does not get control
>Has anyone encountered similar problems or does anyone know the reason for this ?
>Help will be highly appreciated
>
>Thanks
>
>Barun Kumar Yadav
>¬Sapient Bangalore
>Work 91.804.104.7490
>Mobile 91.989.197.4493
>YIM meet_you_23
>
>
>
>
>
>
>