You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohit Gupta <mo...@gmail.com> on 2013/12/06 17:04:10 UTC

param interceptor is not working fine if list contain more than 10 items?

I have customerAtction which customer dataObject. Customer data object
contains arraylist of orders.

If I have 10 order placed from ui then struts 2 works fine and i get  10
orders populated in my customer object

<input type='hidden'  name ='customer.orders[0].item' value ='someItem'/>//
First item
                to
 <input type='hidden'  name ='customer.orders[9].item' value
='someItem'/>// Tenth item

 But if i have 11 items i cet customer object with 11 orders with first and
last order correctly filled  but inbetween 9 orders are correctly filled

 <input type='hidden'  name ='customer.orders[0].item' value
='someItem'/>// First item
                to
 <input type='hidden'  name ='customer.orders[10].item' value
='someItem'/>// Tenth item

 Some how param interceptor is not working fine for more than 10 items. I
am not sure what i am missing here?

Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Mohit Gupta <mo...@gmail.com>.
Lukasz,  i agree it  must be passed as array when parameters having same
name . I think internally struts 2 using
getParameterValues(java.lang.String)<http://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getParameterValues(java.lang.String)>.
instead  getParameter(java.lang.String)<http://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getParameterValues(java.lang.String)>
while
retrieving.


On Tue, Dec 10, 2013 at 12:04 PM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/12/10 Mohit Gupta <mo...@gmail.com>:
> > Changing    <input type='hidden'  name ='customer.orders[0].item' value
> > ='someItem'/> to  <input type='hidden'  name ='customer.orders.item'
> value
> > ='someItem'/>.
> >
> > This works but this is how it is supposed to work ?
>
> It is a normal situation, parameters with the same name are passed as an
> array
>
>
> http://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Lukasz Lenart <lu...@apache.org>.
2013/12/10 Mohit Gupta <mo...@gmail.com>:
> Changing    <input type='hidden'  name ='customer.orders[0].item' value
> ='someItem'/> to  <input type='hidden'  name ='customer.orders.item' value
> ='someItem'/>.
>
> This works but this is how it is supposed to work ?

It is a normal situation, parameters with the same name are passed as an array

http://docs.oracle.com/javaee/5/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Mohit Gupta <mo...@gmail.com>.
Changing    <input type='hidden'  name ='customer.orders[0].item' value
='someItem'/> to  <input type='hidden'  name ='customer.orders.item' value
='someItem'/>.

This works but this is how it is supposed to work ?


On Sat, Dec 7, 2013 at 8:18 AM, Mohit Gupta <mo...@gmail.com> wrote:

> Guys any suggestion/ideas.Really ,I  am not getting whats going on here.
>
>
> On Fri, Dec 6, 2013 at 10:21 PM, Mohit Gupta <mo...@gmail.com> wrote:
>
>> Dave. Here is brief about action class
>>
>> *CustomerOrderAction contains  *
>>  private Customer   customer; // getters and setters
>>
>> * Customer contains*
>>  private List<ShopItem>  orders   = new ArrayList<ShopItem>();
>>
>>  * ShopItem contains*
>>  public int      item           = -1; // getters and setters
>>
>>
>> On Fri, Dec 6, 2013 at 10:09 PM, Dave Newton <da...@gmail.com>wrote:
>>
>>> How is the property defined in the action?
>>>
>>>
>>>
>>> On Fri, Dec 6, 2013 at 11:35 AM, Mohit Gupta <mo...@gmail.com> wrote:
>>>
>>> > correcting typo errors in my previous post
>>> >
>>> > I have customerAtction which customer dataObject. Customer data object
>>> > contains arraylist of orders.
>>> >
>>> > If I have 10 order placed from ui then struts 2 works fine and i get
>>>  10
>>> > orders populated in my customer object
>>> >
>>> > <input type='hidden'  name ='customer.orders[0].item' value
>>> ='someItem'/>//
>>> > First item
>>> >                 to
>>> >  <input type='hidden'  name ='customer.orders[9].item' value
>>> > ='someItem'/>// Tenth item
>>> >
>>> >  But if i have 11 items i cet customer object with 11 orders with
>>> first and
>>> > last order correctly filled  but inbetween 9 orders are not correctly
>>> > filled. In between 9 values are filled as null object
>>> >
>>> >  <input type='hidden'  name ='customer.orders[0].item' value
>>> > ='someItem'/>// First item
>>> >                 to
>>> >  <input type='hidden'  name ='customer.orders[10].item' value
>>> > ='someItem'/>// eleventh item
>>> >
>>> >  Some how param interceptor is not working fine for more than 10
>>> items. I
>>> > am not sure what i am missing here?
>>> >
>>> > ---------- Forwarded message ----------
>>> > From: Mohit Gupta <mo...@gmail.com>
>>> > Date: Fri, Dec 6, 2013 at 9:34 PM
>>> > Subject: param interceptor is not working fine if list contain more
>>> than 10
>>> > items?
>>> > To: Struts Users Mailing List <us...@struts.apache.org>
>>> >
>>> >
>>> >
>>> >
>>> > I have customerAtction which customer dataObject. Customer data object
>>> > contains arraylist of orders.
>>> >
>>> > If I have 10 order placed from ui then struts 2 works fine and i get
>>>  10
>>> > orders populated in my customer object
>>> >
>>> > <input type='hidden'  name ='customer.orders[0].item' value
>>> ='someItem'/>//
>>> > First item
>>> >                 to
>>> >  <input type='hidden'  name ='customer.orders[9].item' value
>>> > ='someItem'/>// Tenth item
>>> >
>>> >  But if i have 11 items i cet customer object with 11 orders with
>>> first and
>>> > last order correctly filled  but inbetween 9 orders are correctly
>>> filled
>>> >
>>> >  <input type='hidden'  name ='customer.orders[0].item' value
>>> > ='someItem'/>// First item
>>> >                 to
>>> >  <input type='hidden'  name ='customer.orders[10].item' value
>>> > ='someItem'/>// Tenth item
>>> >
>>> >  Some how param interceptor is not working fine for more than 10
>>> items. I
>>> > am not sure what i am missing here?
>>> >
>>>
>>>
>>>
>>> --
>>> e: davelnewton@gmail.com
>>> m: 908-380-8699
>>> s: davelnewton_skype
>>> t: @dave_newton <https://twitter.com/dave_newton>
>>> b: Bucky Bits <http://buckybits.blogspot.com/>
>>> g: davelnewton <https://github.com/davelnewton>
>>> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>>>
>>
>>
>

Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Mohit Gupta <mo...@gmail.com>.
Guys any suggestion/ideas.Really ,I  am not getting whats going on here.


On Fri, Dec 6, 2013 at 10:21 PM, Mohit Gupta <mo...@gmail.com> wrote:

> Dave. Here is brief about action class
>
> *CustomerOrderAction contains  *
>  private Customer   customer; // getters and setters
>
> * Customer contains*
>  private List<ShopItem>  orders   = new ArrayList<ShopItem>();
>
>  * ShopItem contains*
>  public int      item           = -1; // getters and setters
>
>
> On Fri, Dec 6, 2013 at 10:09 PM, Dave Newton <da...@gmail.com>wrote:
>
>> How is the property defined in the action?
>>
>>
>>
>> On Fri, Dec 6, 2013 at 11:35 AM, Mohit Gupta <mo...@gmail.com> wrote:
>>
>> > correcting typo errors in my previous post
>> >
>> > I have customerAtction which customer dataObject. Customer data object
>> > contains arraylist of orders.
>> >
>> > If I have 10 order placed from ui then struts 2 works fine and i get  10
>> > orders populated in my customer object
>> >
>> > <input type='hidden'  name ='customer.orders[0].item' value
>> ='someItem'/>//
>> > First item
>> >                 to
>> >  <input type='hidden'  name ='customer.orders[9].item' value
>> > ='someItem'/>// Tenth item
>> >
>> >  But if i have 11 items i cet customer object with 11 orders with first
>> and
>> > last order correctly filled  but inbetween 9 orders are not correctly
>> > filled. In between 9 values are filled as null object
>> >
>> >  <input type='hidden'  name ='customer.orders[0].item' value
>> > ='someItem'/>// First item
>> >                 to
>> >  <input type='hidden'  name ='customer.orders[10].item' value
>> > ='someItem'/>// eleventh item
>> >
>> >  Some how param interceptor is not working fine for more than 10 items.
>> I
>> > am not sure what i am missing here?
>> >
>> > ---------- Forwarded message ----------
>> > From: Mohit Gupta <mo...@gmail.com>
>> > Date: Fri, Dec 6, 2013 at 9:34 PM
>> > Subject: param interceptor is not working fine if list contain more
>> than 10
>> > items?
>> > To: Struts Users Mailing List <us...@struts.apache.org>
>> >
>> >
>> >
>> >
>> > I have customerAtction which customer dataObject. Customer data object
>> > contains arraylist of orders.
>> >
>> > If I have 10 order placed from ui then struts 2 works fine and i get  10
>> > orders populated in my customer object
>> >
>> > <input type='hidden'  name ='customer.orders[0].item' value
>> ='someItem'/>//
>> > First item
>> >                 to
>> >  <input type='hidden'  name ='customer.orders[9].item' value
>> > ='someItem'/>// Tenth item
>> >
>> >  But if i have 11 items i cet customer object with 11 orders with first
>> and
>> > last order correctly filled  but inbetween 9 orders are correctly filled
>> >
>> >  <input type='hidden'  name ='customer.orders[0].item' value
>> > ='someItem'/>// First item
>> >                 to
>> >  <input type='hidden'  name ='customer.orders[10].item' value
>> > ='someItem'/>// Tenth item
>> >
>> >  Some how param interceptor is not working fine for more than 10 items.
>> I
>> > am not sure what i am missing here?
>> >
>>
>>
>>
>> --
>> e: davelnewton@gmail.com
>> m: 908-380-8699
>> s: davelnewton_skype
>> t: @dave_newton <https://twitter.com/dave_newton>
>> b: Bucky Bits <http://buckybits.blogspot.com/>
>> g: davelnewton <https://github.com/davelnewton>
>> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>>
>
>

Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Mohit Gupta <mo...@gmail.com>.
Dave. Here is brief about action class

*CustomerOrderAction contains  *
 private Customer   customer; // getters and setters

* Customer contains*
 private List<ShopItem>  orders   = new ArrayList<ShopItem>();

 * ShopItem contains*
 public int      item           = -1; // getters and setters


On Fri, Dec 6, 2013 at 10:09 PM, Dave Newton <da...@gmail.com> wrote:

> How is the property defined in the action?
>
>
>
> On Fri, Dec 6, 2013 at 11:35 AM, Mohit Gupta <mo...@gmail.com> wrote:
>
> > correcting typo errors in my previous post
> >
> > I have customerAtction which customer dataObject. Customer data object
> > contains arraylist of orders.
> >
> > If I have 10 order placed from ui then struts 2 works fine and i get  10
> > orders populated in my customer object
> >
> > <input type='hidden'  name ='customer.orders[0].item' value
> ='someItem'/>//
> > First item
> >                 to
> >  <input type='hidden'  name ='customer.orders[9].item' value
> > ='someItem'/>// Tenth item
> >
> >  But if i have 11 items i cet customer object with 11 orders with first
> and
> > last order correctly filled  but inbetween 9 orders are not correctly
> > filled. In between 9 values are filled as null object
> >
> >  <input type='hidden'  name ='customer.orders[0].item' value
> > ='someItem'/>// First item
> >                 to
> >  <input type='hidden'  name ='customer.orders[10].item' value
> > ='someItem'/>// eleventh item
> >
> >  Some how param interceptor is not working fine for more than 10 items. I
> > am not sure what i am missing here?
> >
> > ---------- Forwarded message ----------
> > From: Mohit Gupta <mo...@gmail.com>
> > Date: Fri, Dec 6, 2013 at 9:34 PM
> > Subject: param interceptor is not working fine if list contain more than
> 10
> > items?
> > To: Struts Users Mailing List <us...@struts.apache.org>
> >
> >
> >
> >
> > I have customerAtction which customer dataObject. Customer data object
> > contains arraylist of orders.
> >
> > If I have 10 order placed from ui then struts 2 works fine and i get  10
> > orders populated in my customer object
> >
> > <input type='hidden'  name ='customer.orders[0].item' value
> ='someItem'/>//
> > First item
> >                 to
> >  <input type='hidden'  name ='customer.orders[9].item' value
> > ='someItem'/>// Tenth item
> >
> >  But if i have 11 items i cet customer object with 11 orders with first
> and
> > last order correctly filled  but inbetween 9 orders are correctly filled
> >
> >  <input type='hidden'  name ='customer.orders[0].item' value
> > ='someItem'/>// First item
> >                 to
> >  <input type='hidden'  name ='customer.orders[10].item' value
> > ='someItem'/>// Tenth item
> >
> >  Some how param interceptor is not working fine for more than 10 items. I
> > am not sure what i am missing here?
> >
>
>
>
> --
> e: davelnewton@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>

Re: param interceptor is not working fine if list contain more than 10 items?

Posted by Dave Newton <da...@gmail.com>.
How is the property defined in the action?



On Fri, Dec 6, 2013 at 11:35 AM, Mohit Gupta <mo...@gmail.com> wrote:

> correcting typo errors in my previous post
>
> I have customerAtction which customer dataObject. Customer data object
> contains arraylist of orders.
>
> If I have 10 order placed from ui then struts 2 works fine and i get  10
> orders populated in my customer object
>
> <input type='hidden'  name ='customer.orders[0].item' value ='someItem'/>//
> First item
>                 to
>  <input type='hidden'  name ='customer.orders[9].item' value
> ='someItem'/>// Tenth item
>
>  But if i have 11 items i cet customer object with 11 orders with first and
> last order correctly filled  but inbetween 9 orders are not correctly
> filled. In between 9 values are filled as null object
>
>  <input type='hidden'  name ='customer.orders[0].item' value
> ='someItem'/>// First item
>                 to
>  <input type='hidden'  name ='customer.orders[10].item' value
> ='someItem'/>// eleventh item
>
>  Some how param interceptor is not working fine for more than 10 items. I
> am not sure what i am missing here?
>
> ---------- Forwarded message ----------
> From: Mohit Gupta <mo...@gmail.com>
> Date: Fri, Dec 6, 2013 at 9:34 PM
> Subject: param interceptor is not working fine if list contain more than 10
> items?
> To: Struts Users Mailing List <us...@struts.apache.org>
>
>
>
>
> I have customerAtction which customer dataObject. Customer data object
> contains arraylist of orders.
>
> If I have 10 order placed from ui then struts 2 works fine and i get  10
> orders populated in my customer object
>
> <input type='hidden'  name ='customer.orders[0].item' value ='someItem'/>//
> First item
>                 to
>  <input type='hidden'  name ='customer.orders[9].item' value
> ='someItem'/>// Tenth item
>
>  But if i have 11 items i cet customer object with 11 orders with first and
> last order correctly filled  but inbetween 9 orders are correctly filled
>
>  <input type='hidden'  name ='customer.orders[0].item' value
> ='someItem'/>// First item
>                 to
>  <input type='hidden'  name ='customer.orders[10].item' value
> ='someItem'/>// Tenth item
>
>  Some how param interceptor is not working fine for more than 10 items. I
> am not sure what i am missing here?
>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Fwd: param interceptor is not working fine if list contain more than 10 items?

Posted by Mohit Gupta <mo...@gmail.com>.
correcting typo errors in my previous post

I have customerAtction which customer dataObject. Customer data object
contains arraylist of orders.

If I have 10 order placed from ui then struts 2 works fine and i get  10
orders populated in my customer object

<input type='hidden'  name ='customer.orders[0].item' value ='someItem'/>//
First item
                to
 <input type='hidden'  name ='customer.orders[9].item' value
='someItem'/>// Tenth item

 But if i have 11 items i cet customer object with 11 orders with first and
last order correctly filled  but inbetween 9 orders are not correctly
filled. In between 9 values are filled as null object

 <input type='hidden'  name ='customer.orders[0].item' value
='someItem'/>// First item
                to
 <input type='hidden'  name ='customer.orders[10].item' value
='someItem'/>// eleventh item

 Some how param interceptor is not working fine for more than 10 items. I
am not sure what i am missing here?

---------- Forwarded message ----------
From: Mohit Gupta <mo...@gmail.com>
Date: Fri, Dec 6, 2013 at 9:34 PM
Subject: param interceptor is not working fine if list contain more than 10
items?
To: Struts Users Mailing List <us...@struts.apache.org>




I have customerAtction which customer dataObject. Customer data object
contains arraylist of orders.

If I have 10 order placed from ui then struts 2 works fine and i get  10
orders populated in my customer object

<input type='hidden'  name ='customer.orders[0].item' value ='someItem'/>//
First item
                to
 <input type='hidden'  name ='customer.orders[9].item' value
='someItem'/>// Tenth item

 But if i have 11 items i cet customer object with 11 orders with first and
last order correctly filled  but inbetween 9 orders are correctly filled

 <input type='hidden'  name ='customer.orders[0].item' value
='someItem'/>// First item
                to
 <input type='hidden'  name ='customer.orders[10].item' value
='someItem'/>// Tenth item

 Some how param interceptor is not working fine for more than 10 items. I
am not sure what i am missing here?