Forums de discussion

Event request set attibute not working

thumbnail
Syed Nasar, modifié il y a 7 années.

Event request set attibute not working

Junior Member Publications: 64 Date d'inscription: 03/09/15 Publications récentes
Hi,
I am working on IPC by event.
I am getting null value in jsp which is set in event method through request.setAttribute.
My controller and jsp as follows,

In my controller,

public void myEvent(EventRequest request, EventResponse response) {
Event event = request.getEvent();
List<SubscriberRecord> subscriberRecords = (List<SubscriberRecord>) event.getValue();
request.setAttribute("subscriberRecords" , subscriberRecords);
}

In my jsp,
<%
List<SubscriberRecord> subscriberRecords = (List<SubscriberRecord>) request.getAttribute("subscriberRecords");
%>
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: Event request set attibute not working

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
It is different requests.

In the java code you're responding to an IPC event, but in the JSP the "request" object is the HttpServletRequest object. The event phase happens before the render phase so the event request will not be available during render.







Come meet me at the LSNA!