Does anyone know if its possible to determine what kind of PortletRequest (Action/Render/etc) is being triggered from the raw ServletRequest? Before the Portlet Container interceptors have fired.

If it's not possible, does anyone have any objections to modifying PC to set a value onto the request to make it identifiable?

An initial thought is to modify ContextDispatcherInterceptor.invoke() from

    CallableImpl callable = new CallableImpl(invocation);
    reqCtx.dispatch(targetCtx, invocation.getRequest(), invocation.getResponse(), callable);
    return callable.response;

to

    CallableImpl callable = new CallableImpl(invocation);
    invocation.getRequest().setAttribute("cdi.portlet.invocation", invocation);
    reqCtx.dispatch(targetCtx, invocation.getRequest(), invocation.getResponse(), callable);
    return callable.response;

The actual attribute name I've just set to anything to illustrate the code at present.

If not the invocation itself, then can we set an Enum or integer value to indicate the portlet request type?

Thanks
Ken
 
========================
Senior Software Engineer / JBoss Enterprise Middleware Red Hat, Inc.