Sagar Rohankar, thanks a lot for your time and answer!
I know that this is one of the good solutions, but here is the thing:
In my application I use my custom ActionSupport class "
MyActionSupport" that extends ActionSupport and allways uses this
list ( currently from session ).
MyActionSupport almost always needs this
list in order to manipulate some DB data properly.
And every ActionClass in my application that is of type "
MyActionSupport" uses different instance of "
MyList".
Sometimes it is a list of 4 elements , sometimes it's a list of 10 elements, and so on...
It depends which DB table I am processing with it...
So, If a user opens a tab in the browser to work with
employees table, for example, he is going to need a list of 10 objects, each with it's properties set to some values.
At the same time,
in another tab of the browser, he opens an application and work around with
sales table, and for that
MyActionSupport class uses a list of , for example, 20 objects, each with it's properties set to some other values than the ones in
list for employees...
So, we have two different lists that needs to be set in the session or somewhere else.
At this moment, on execute() ,
MyActionSupport allways rewrites the current list in the session and sets it's value with the one in itself.
So, this is a problem...
I hope I explained it a little better...
Is there some other solution for passing a list of objects between two action classes ove a view ( some .jsp page )?
Hmmm... I already see myself putting this list in a map ( HashMap<
String,ArrayList><MyObject>> , where the key is the name of the instance of the action that set the list, and the value is the list that this action contains... ) so that every action class uses it's own list...
In your opinion, would this be a good solution...?