• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to access List (arrayList) values edited in jsp in action

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am making a shopingCart, where column, Qty's value is changing at front-end. This column populated by a ArrayList Object.

I am changing the value at front-end and want my action class to access this changed value.

Can Any one help me with solution?

<s:iterator value="shoppingCart" status="stat">
<s:textfield name="shoppingCart[#stat.index].qty" />


In the action I have getter/setter with shoppingCart. but i am getting shoppingCart object as null.

Regards
 
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try to set the name of property for this textfield

or read this documentation
http://struts.apache.org/2.1.8/docs/textfield.html
 
aparna aigal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mahesh,
 
aparna aigal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mahesh,
 
aparna aigal
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It generates the collection in the property of the action class.

But when we are trying to use<s:property ...... > in jsp, it generates
<tr><td>..</td><td>value from property</td></tr>

Due to that table format in html is going vague. Can any one tell how to avoid automatic <tr>&<td>.

Or any other tags used instead..?
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I will suggest you to please go through the struts2 documentation(acourding to your struts2 version).
because you dont know the tags properly and this directly affects your performace.
Documentation is good and infornative go through it first.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic