Skip to content

The PortletWrappingController in spring-mvc-portlet is not supporting EventHandling for JSR268 wrapped portlets [SPR-7430] #12088

@spring-projects-issues

Description

@spring-projects-issues

Roger Rumao opened SPR-7430 and commented

In the current version of Spring-mvc-portlet 3.0.3, The org.springframework.web.portlet.mvc.PortletWrappingController cannot handle the events for wrapped jsr268 portlets.

While handling the portlet event in DispatcherPortlet, it checks if the portletController is instanceof EventAwareController or not and sends the event to the portletController.processEvent() only if its EventAwareController.

In case of wrapped portlet, the actual external portlet is wrapped within the org.springframework.web.portlet.mvc.PortletWrappingController and the Default PortletWrappingController in spring-mvc-portlet is not implementing the EventAwareController to provide the functionality to pass the event to wrapped portlet.

So if there is wrapped jsr 268 portlet which can support events, due to the above issue the event will never be processed.

Currently I am trying with myfaces portlet bridge 2.0.0 beta and try to include in the myfaces portlet in spring-mvc-portlet

For workaround to this issue. I have extended the org.springframework.web.portlet.mvc.PortletWrappingController in my application and created new class which implements EventAwareController
Public class CustomPortletWrappingController extends AbstractController
implements BeanNameAware, InitializingBean, DisposableBean, PortletContextAware, PortletConfigAware , EventAwareController {

and implement the method to pass the event to the wrapped portlet as
public void handleEventRequest(EventRequest request, EventResponse response) {
if(this.portletInstance instanceof GenericPortlet){
((GenericPortlet)this.portletInstance).processEvent(request, response);
}
}

Which then passes the event to the wrapped portlet.


Affects: 3.0.2, 3.0.3

Referenced from: commits 4af3645

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions