struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li <ampyx...@gmail.com>
Subject Re: ***** Passing an ArrayList to action from JSP ****
Date Mon, 24 Apr 2006 09:55:13 GMT
Hi Pal,

You can save arraylist object in your session object container (if you have,
normally is a java bean), then you can pass through the arraylist object in
an active session.

Let's say you have a form called Form1 which is a action form,
inside the form, you can add an arraylist, so when you submit the form, the
arraylist will also be submitted to the server.

You probably also need create an entry in the session object container, so
that you can use it without calling through the form.

To get the arraylist value and display on jsp:
In your action class:
Extract arraylist values and save it to the object your created in the
session object container
then, update the session object container in the session.
In your jsp:
Call the session object and extract the arraylist object with its items (I
am sure you know how to do it)

To submit the arraylist and get it in your action class:
Since you have arraylist object within the form. once you submit the form,
the action form is passed to the action class.

In your action class:
Get the form from session, extract the arraylist and do something ...

Wish it could help ~

On 4/24/06, Sony Thomas <sony@genialgenetics.com> wrote:
>
> Hi Friends,
>
> I have a dropdown list in my jsp created in the action. When I submit my
> jsp, Is there is any way to submit my arraylist as well?
>
> Total workflow follows :
>
> creating an arraylist of values to be displayed in the jsp in Action
> class.
>
> When I submit the jsp the arrayList should resubmit to the Action class.
>
> If anyone has any idea please put through.
>
> thanks in advance
>
> Sony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--
=====================================
The world will be ended if love is everywhere.
                                               ---- Shawzi

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message