cancel
Showing results for 
Search instead for 
Did you mean: 

How to store complex data in session object

Former Member
0 Kudos

Hi All,

I have a requirement like this, I have to store some complex data(like some object) in webdynpro session object.

I know that i can store some string value in session by using wdScopeUtil and is it possible to store some complex data like(object ot object array).

See i have some ContryTO[] object which contains countrycode and value i have to store this Array object in session.How can I solve this problem,i am strucked regarding this pls help me regarding this issue.

Regards,

saleem

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Can you elaborate your requirement related with the lifetime expectancy of the session. If you want some data to be stored till the life time of your WD application you can use the controller context to store this.

Regards

Ayyapparaj

Former Member
0 Kudos

My Scenario is like this .

I am getting a ArrayList object from database and want to store it somewhere so that i can use the same list in the entire application without going to database again and again.

i thought of using WDScopeUtil.put(WDScopeType.APPLICATION_SCOPE, but it can store only sting objects.

hope you understand the problem if yes please get back to me with a solution

bala

sridhar_k2
Active Contributor
0 Kudos

Bala,

Go thru this link. It may be useful to you.

List elementList = new ArrayList();

// set values to your list.

IMaintainScope maintainer = Utils.getScopeMaintainer(WDScopeType.APPLICATION_SCOPE);

maintainer.getScope().put("list",elementList);

List elementList1 = (List)maintainer.getScope().get("list");

Regards,

Sridhar

Former Member
0 Kudos

Hi sridhar,

very helpful answer which u have given me.I solved my problem.

I rewarded the points for ur answer.

Regards,

saleem

Former Member
0 Kudos

thanks sridhar that solved my problem too

Former Member
0 Kudos

Hi,

I think you need to create a similar structure in your WD context and set the individual attributes from your transfer objects.

Regards,

Murtuza

Former Member
0 Kudos

even i am facing with the same problem.I need to store the database results in session so that i need not go to database everytime.

somebody help us in resolving this issue