You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jon.Ridgway" <Jo...@upco.co.uk> on 2001/07/10 12:06:35 UTC

RE: Iterate problem - Any Solutions !!!!!!

Hi Suhas,

I seem to remember a problem with arrays being used in this way. Someone on
this list created some new indexed tags you can grab from Teds site. Not
certain but have a look at:

http://www.husted.com/about/struts/resources.htm#contributions

Specifically have a look at the Indexed Tags:

http://husted.com/about/struts/indexed-tags.htm

Jon.

-----Original Message-----
From: suhas [mailto:suhas_k@techmas.hcltech.com] 
Sent: 10 July 2001 15:20
To: struts-user@jakarta.apache.org
Subject: Iterate problem - Any Solutions !!!!!!

I still struggling with iterate problem still . Any solutions ???? . I do
have the proper getter methods in the OverDueOrderView .

getting  Here I'm getting **in side the getView of UpdateOrder Form 0 **
printed
 with following error message      javax.servlet.ServletException: Exception
thrown by getter for  view[0].orderNo of bean
org.apache.struts.taglib.html.BEAN !!!!!!!!


<logic:iterate id="view" name="updateOrderForm" property="views"
type="example.testorder.OverDueOrderView">

<tr>
<td>
<html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
</td>
<td>
<html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
</td>
<td>
<html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
</td>
</tr>

<% index++ ;%>
</logic:iterate>

----- Original Message -----
From: suhas <su...@techmas.hcltech.com>
To: <st...@jakarta.apache.org>
Sent: Tuesday, July 10, 2001 2:02 PM
Subject: Re: Iterate problem


> it is goes something like this .
>
> private String orderNo ;
>
> public String getOrderNo() {
>     return orderNo ;
> }
>
>
> ----- Original Message -----
> From: <gu...@systor.com>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, July 10, 2001 8:28 AM
> Subject: Re: Iterate problem
>
>
> >
> > Hi
> >
> > The parts you show look correct to me. It seems that the problem lies in
> > the code of method OverDueOrderView.getOrderNo(), which you have not
> copied
> > to the mail.
> >
> > Guido
> >
> >
> >
> >
> >                                "suhas"
> >                    <suhas_k@techmas.hc       To:
> <st...@jakarta.apache.org>
> >                             ltech.com>       cc:
> >                                              Subject:  Iterate problem
> >
> >                       10.07.2001 11:55
> >                      Please respond to
> >                            struts-user
> >
> >
> >
> >
> > Hi I have a question
> >
> > My Iterate tag goes like this
> >
> > <logic:iterate id="view" name="updateOrderForm" property="views" type
> > ="example.testorder.OverDueOrderView">
> >
> > <tr>
> > <td>
> > <html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
> > </td>
> > <td>
> > <html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
> > </td>
> > <td>
> > <html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
> > </td>
> > </tr>
> > <% index++ ;%>
> > </logic:iterate>
> > Do I need **IndexId** here as an attribute in the iterate Tag  ??? 'cos
In
> > my form bean when showing the above table there is a call to
> >  public OverDueOrderView getView(int index) {
> >       System.out.println(" in side the getView of UpdateOrder Form "+
> > index);
> >   return (OverDueOrderView)views.get(index);
> >  }
> >
> > Here I'm getting **in side the getView of UpdateOrder Form 0 **  printed
> > with following error message
> >      javax.servlet.ServletException: Exception thrown by getter for
> > view[0].orderNo of bean org.apache.struts.taglib.html.BEAN
> >
> > What can be the problem -- IS it 'cos i'm not specifying indexId
attribute
> > in the iterate tag or something else ???
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >

Re: Iterate problem - Any Solutions !!!!!! - SOLVED FINALLY

Posted by suhas <su...@techmas.hcltech.com>.
Another point -
The iterate tag used here is just acting as a for loop . I mean  the
scripting variable it exposes is not at all useful in this scenario .

Any comments !!!!!

Suhas

----- Original Message -----
From: suhas <su...@techmas.hcltech.com>
To: <st...@jakarta.apache.org>
Cc: Gregor Rayman <gr...@gmx.net>
Sent: Tuesday, July 10, 2001 4:26 PM
Subject: Re: Iterate problem - Any Solutions !!!!!! - SOLVED FINALLY


> It worked at last . No other change needed .
> This is how -
>
> <logic:iterate id="element" name="updateOrderForm" property="views"
> type="example.testorder.OverDueOrderView">
> <tr>
> <td>
> <html:text name="updateOrderForm"  property='<%= "view[" + index+
> "]"+".orderNo" %>' />
> </td>
> <td>
> <html:text name="updateOrderForm"  property='<%= "view["+ index+
> "]"+".salesDiv" %>' />
> </td>
> <td>
> <html:text name="updateOrderForm"  property='<%= "view["+ index+
> "]"+".productOrdered" %>' />
> </td>
> </tr>
>
>
>
>
>
> ----- Original Message -----
> From: Jon.Ridgway <Jo...@upco.co.uk>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, July 10, 2001 11:06 AM
> Subject: RE: Iterate problem - Any Solutions !!!!!!
>
>
> > Hi Suhas,
> >
> > I seem to remember a problem with arrays being used in this way. Someone
> on
> > this list created some new indexed tags you can grab from Teds site. Not
> > certain but have a look at:
> >
> > http://www.husted.com/about/struts/resources.htm#contributions
> >
> > Specifically have a look at the Indexed Tags:
> >
> > http://husted.com/about/struts/indexed-tags.htm
> >
> > Jon.
> >
> > -----Original Message-----
> > From: suhas [mailto:suhas_k@techmas.hcltech.com]
> > Sent: 10 July 2001 15:20
> > To: struts-user@jakarta.apache.org
> > Subject: Iterate problem - Any Solutions !!!!!!
> >
> > I still struggling with iterate problem still . Any solutions ???? . I
do
> > have the proper getter methods in the OverDueOrderView .
> >
> > getting  Here I'm getting **in side the getView of UpdateOrder Form 0 **
> > printed
> >  with following error message      javax.servlet.ServletException:
> Exception
> > thrown by getter for  view[0].orderNo of bean
> > org.apache.struts.taglib.html.BEAN !!!!!!!!
> >
> >
> > <logic:iterate id="view" name="updateOrderForm" property="views"
> > type="example.testorder.OverDueOrderView">
> >
> > <tr>
> > <td>
> > <html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
> > </td>
> > <td>
> > <html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
> > </td>
> > <td>
> > <html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
> > </td>
> > </tr>
> >
> > <% index++ ;%>
> > </logic:iterate>
> >
> > ----- Original Message -----
> > From: suhas <su...@techmas.hcltech.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Tuesday, July 10, 2001 2:02 PM
> > Subject: Re: Iterate problem
> >
> >
> > > it is goes something like this .
> > >
> > > private String orderNo ;
> > >
> > > public String getOrderNo() {
> > >     return orderNo ;
> > > }
> > >
> > >
> > > ----- Original Message -----
> > > From: <gu...@systor.com>
> > > To: <st...@jakarta.apache.org>
> > > Sent: Tuesday, July 10, 2001 8:28 AM
> > > Subject: Re: Iterate problem
> > >
> > >
> > > >
> > > > Hi
> > > >
> > > > The parts you show look correct to me. It seems that the problem
lies
> in
> > > > the code of method OverDueOrderView.getOrderNo(), which you have not
> > > copied
> > > > to the mail.
> > > >
> > > > Guido
> > > >
> > > >
> > > >
> > > >
> > > >                                "suhas"
> > > >                    <suhas_k@techmas.hc       To:
> > > <st...@jakarta.apache.org>
> > > >                             ltech.com>       cc:
> > > >                                              Subject:  Iterate
problem
> > > >
> > > >                       10.07.2001 11:55
> > > >                      Please respond to
> > > >                            struts-user
> > > >
> > > >
> > > >
> > > >
> > > > Hi I have a question
> > > >
> > > > My Iterate tag goes like this
> > > >
> > > > <logic:iterate id="view" name="updateOrderForm" property="views"
type
> > > > ="example.testorder.OverDueOrderView">
> > > >
> > > > <tr>
> > > > <td>
> > > > <html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
> > > > </td>
> > > > <td>
> > > > <html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
> > > > </td>
> > > > <td>
> > > > <html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
> > > > </td>
> > > > </tr>
> > > > <% index++ ;%>
> > > > </logic:iterate>
> > > > Do I need **IndexId** here as an attribute in the iterate Tag  ???
> 'cos
> > In
> > > > my form bean when showing the above table there is a call to
> > > >  public OverDueOrderView getView(int index) {
> > > >       System.out.println(" in side the getView of UpdateOrder Form
"+
> > > > index);
> > > >   return (OverDueOrderView)views.get(index);
> > > >  }
> > > >
> > > > Here I'm getting **in side the getView of UpdateOrder Form 0 **
> printed
> > > > with following error message
> > > >      javax.servlet.ServletException: Exception thrown by getter for
> > > > view[0].orderNo of bean org.apache.struts.taglib.html.BEAN
> > > >
> > > > What can be the problem -- IS it 'cos i'm not specifying indexId
> > attribute
> > > > in the iterate tag or something else ???
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >


Re: Iterate problem - Any Solutions !!!!!! - SOLVED FINALLY

Posted by suhas <su...@techmas.hcltech.com>.
It worked at last . No other change needed .
This is how -

<logic:iterate id="element" name="updateOrderForm" property="views"
type="example.testorder.OverDueOrderView">
<tr>
<td>
<html:text name="updateOrderForm"  property='<%= "view[" + index+
"]"+".orderNo" %>' />
</td>
<td>
<html:text name="updateOrderForm"  property='<%= "view["+ index+
"]"+".salesDiv" %>' />
</td>
<td>
<html:text name="updateOrderForm"  property='<%= "view["+ index+
"]"+".productOrdered" %>' />
</td>
</tr>





----- Original Message -----
From: Jon.Ridgway <Jo...@upco.co.uk>
To: <st...@jakarta.apache.org>
Sent: Tuesday, July 10, 2001 11:06 AM
Subject: RE: Iterate problem - Any Solutions !!!!!!


> Hi Suhas,
>
> I seem to remember a problem with arrays being used in this way. Someone
on
> this list created some new indexed tags you can grab from Teds site. Not
> certain but have a look at:
>
> http://www.husted.com/about/struts/resources.htm#contributions
>
> Specifically have a look at the Indexed Tags:
>
> http://husted.com/about/struts/indexed-tags.htm
>
> Jon.
>
> -----Original Message-----
> From: suhas [mailto:suhas_k@techmas.hcltech.com]
> Sent: 10 July 2001 15:20
> To: struts-user@jakarta.apache.org
> Subject: Iterate problem - Any Solutions !!!!!!
>
> I still struggling with iterate problem still . Any solutions ???? . I do
> have the proper getter methods in the OverDueOrderView .
>
> getting  Here I'm getting **in side the getView of UpdateOrder Form 0 **
> printed
>  with following error message      javax.servlet.ServletException:
Exception
> thrown by getter for  view[0].orderNo of bean
> org.apache.struts.taglib.html.BEAN !!!!!!!!
>
>
> <logic:iterate id="view" name="updateOrderForm" property="views"
> type="example.testorder.OverDueOrderView">
>
> <tr>
> <td>
> <html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
> </td>
> <td>
> <html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
> </td>
> <td>
> <html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
> </td>
> </tr>
>
> <% index++ ;%>
> </logic:iterate>
>
> ----- Original Message -----
> From: suhas <su...@techmas.hcltech.com>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, July 10, 2001 2:02 PM
> Subject: Re: Iterate problem
>
>
> > it is goes something like this .
> >
> > private String orderNo ;
> >
> > public String getOrderNo() {
> >     return orderNo ;
> > }
> >
> >
> > ----- Original Message -----
> > From: <gu...@systor.com>
> > To: <st...@jakarta.apache.org>
> > Sent: Tuesday, July 10, 2001 8:28 AM
> > Subject: Re: Iterate problem
> >
> >
> > >
> > > Hi
> > >
> > > The parts you show look correct to me. It seems that the problem lies
in
> > > the code of method OverDueOrderView.getOrderNo(), which you have not
> > copied
> > > to the mail.
> > >
> > > Guido
> > >
> > >
> > >
> > >
> > >                                "suhas"
> > >                    <suhas_k@techmas.hc       To:
> > <st...@jakarta.apache.org>
> > >                             ltech.com>       cc:
> > >                                              Subject:  Iterate problem
> > >
> > >                       10.07.2001 11:55
> > >                      Please respond to
> > >                            struts-user
> > >
> > >
> > >
> > >
> > > Hi I have a question
> > >
> > > My Iterate tag goes like this
> > >
> > > <logic:iterate id="view" name="updateOrderForm" property="views" type
> > > ="example.testorder.OverDueOrderView">
> > >
> > > <tr>
> > > <td>
> > > <html:text property='<%= "view[" + index+ "]"+".orderNo" %>' />
> > > </td>
> > > <td>
> > > <html:text property='<%= "view["+index+ "]"+".salesDiv" %>' />
> > > </td>
> > > <td>
> > > <html:text property='<%= "view["+index+ "]"+".productOrdered" %>' />
> > > </td>
> > > </tr>
> > > <% index++ ;%>
> > > </logic:iterate>
> > > Do I need **IndexId** here as an attribute in the iterate Tag  ???
'cos
> In
> > > my form bean when showing the above table there is a call to
> > >  public OverDueOrderView getView(int index) {
> > >       System.out.println(" in side the getView of UpdateOrder Form "+
> > > index);
> > >   return (OverDueOrderView)views.get(index);
> > >  }
> > >
> > > Here I'm getting **in side the getView of UpdateOrder Form 0 **
printed
> > > with following error message
> > >      javax.servlet.ServletException: Exception thrown by getter for
> > > view[0].orderNo of bean org.apache.struts.taglib.html.BEAN
> > >
> > > What can be the problem -- IS it 'cos i'm not specifying indexId
> attribute
> > > in the iterate tag or something else ???
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >