Foren

Best way to store value in portlet

resmi mathew, geändert vor 12 Jahren.

Best way to store value in portlet

New Member Beiträge: 18 Beitrittsdatum: 02.02.11 Neueste Beiträge
Hi All,
I need to store a variable that can be shared in the same portlet. I need to have a solution other than session.
Requirement is
a. In a portlets one action method I want to store a value and in another action method of same portlet I need to get back the data stored .
What is the best way for this other than using session?

Thanks
Resmy
thumbnail
Raja Nagendra Kumar, geändert vor 12 Jahren.

RE: Best way to store value in portlet

Expert Beiträge: 484 Beitrittsdatum: 02.03.06 Neueste Beiträge
Any reason for avoiding portlet session.. session meant to fullfill the same need..

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
-Liferay Adoption Consulting
resmi mathew, geändert vor 12 Jahren.

RE: Best way to store value in portlet

New Member Beiträge: 18 Beitrittsdatum: 02.02.11 Neueste Beiträge
I am using Liferay's multi file upload in a custom portlet.
upload component is added to a form that has many other input fields.
when user uploads a file it calls one action class and files will be stored to DLFileEntry table.
I need to get the uploaded file information when user submits the form data.this time portlet calls different action method.

I tried to store values in session in upload action and to get back in another action method.It seems multi file upload creates a new httpRequest so the values stored in that session won't be available in another action method.
thumbnail
Jitendra Rajput, geändert vor 12 Jahren.

RE: Best way to store value in portlet

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
Are you using sendRedirect() at the end of your first action ?
thumbnail
Leo Pratlong, geändert vor 12 Jahren.

RE: Best way to store value in portlet

Expert Beiträge: 363 Beitrittsdatum: 06.07.10 Neueste Beiträge
Hi,

you can store it in a PortletSession (with PortletSession.PORTLET_SCOPE or PortletSession.APPLICATION_SCOPE). It will work.