Forums

Home » Alloy UI » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anil singh Gurjar
how to set the List in session in liferay
March 30, 2012 4:13 AM
Answer

Anil singh Gurjar

Rank: New Member

Posts: 18

Join Date: October 31, 2011

Recent Posts

Hello friends

i am getting problem to set the my list in session and how to getting
i am genrating the list in action class and i want to acess that on view.jsp page
plz any one help me

Thanks in advance
Raja Seth
RE: how to set the List in session in liferay
March 30, 2012 4:35 AM
Answer

Raja Seth

Rank: Regular Member

Posts: 227

Join Date: August 18, 2011

Recent Posts

How are you doing it can u pls share?
Anil singh Gurjar
RE: how to set the List in session in liferay
March 30, 2012 5:05 AM
Answer

Anil singh Gurjar

Rank: New Member

Posts: 18

Join Date: October 31, 2011

Recent Posts

Hello Raja sir


i am doing like that in my action class like that i setting
HttpSession session = PortalUtil.getHttpServletRequest(actionRequest).getSession();
session.setAttribute("eventList", eventList);
SessionMessages.add(actionRequest, "");

actionResponse.setRenderParameter("jspPage", actionRequest.getParameter("jspPage"));

and in my view.jsp like that i am getting

PortletURL iteratorURL = renderResponse.createRenderURL();
iteratorURL.setParameter("jspPage", "html/trainingevent/view.jsp");
iteratorURL.setParameter(ActionRequest.ACTION_NAME,"locationSearch");
eventList1 = (List<TrainingEvent>) session.getAttribute("eventList");

but when i am using eventList1.size ()of any it giving error


plz help me
Mayur Patel
RE: how to set the List in session in liferay
May 4, 2012 10:32 PM
Answer

Mayur Patel

Rank: Expert

Posts: 357

Join Date: November 17, 2010

Recent Posts

In processAction, use actionResponse.setRenderParameter(java.lang.String key, java.lang.String[] values)

in receiving JSP, use renderRequest.getParameterValues(java.lang.String name)

Thanks
Anil singh Gurjar
RE: how to set the List in session in liferay
April 3, 2012 1:46 AM
Answer

Anil singh Gurjar

Rank: New Member

Posts: 18

Join Date: October 31, 2011

Recent Posts

Hello Mayur Patel sir


I have tried but in this way actionResponse.setRenderParameter

this method takes string type and i have to set the value of my List of objeft
that is List<TrainingEvent> event List I have to send this in my jsp page from action class

plz guide
Atin Agarwal
RE: how to set the List in session in liferay
May 3, 2012 5:46 AM
Answer

Atin Agarwal

Rank: Junior Member

Posts: 86

Join Date: February 19, 2012

Recent Posts

Hi

that is List<TrainingEvent> event List I have to send this in my jsp page from action class


In your action class-
You might have used List<TrainingEvent>eventList=.......
then session.setAttribute("event",eventList);
something lyk that

In your jsp you can try this-
TrainingEvent event=(TrainingEvent ) session.getAttribute("event");
//i.e. you have to create a variable of type TrainingEvent typecasted then you can access its values.
and then you can access the values through "event" variable.

Hope it wud work.

Regards.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!