cancel
Showing results for 
Search instead for 
Did you mean: 

profile.putValue(String,Object)

Former Member
0 Kudos

Hello,

I have an iView developed for EP5, now I want to migrate this iview to EP6. I use this instruction to save the bean in EP5:

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();

IPortalComponentContext myContext = request.getComponentContext();

IPortalComponentProfile myProfile = myContext.getProfile();

myProfile.putValue("myBean", myBean);

But I get the following warning in Eclipse when I use EP6

The method putValue(String, Object) from the type IPortalComponentProfile is deprecated, what I need to use, to preserve the functionality of myProfile.putValue("myBean", myBean);

Thanks

Maria Teresa

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thanks for your answer. I will check the link.

Another questions, what is the difference if I use

mycontext.putValue("myBean",myBean);

Thanks

Maria Teresa

Former Member
0 Kudos

Hi Maria,

you should check the link dealing with storing beans. I used the name mySession to represent the ComponentSession-Object. Apparently beans should be stored in the Session object and not in the Component Context.

I am not too deep in the "request-handling-stuff", but the objects you put in the component objects are stored and handled differently.

Holger.

Former Member
0 Kudos

Hi Maria,

you could store the Bean like this:


IPortalComponentRequest request =
	(IPortalComponentRequest) this.getRequest();
IPortalComponentSession mySession = request.getComponentSession();			
...
mySession.putValue("myBeanName", myBean);

If you want to get a good overview of where to store objects go to Java Dev - Documentation - Services - Basic Functionality - Beans.

Hope this helps,

Holger.