Re: Using ServletRequestAttributeListener(s) in Pluto

Eric Dalquist <[email protected]> Thu, 30 Jul 2009 19:53:30 -0500
Newsgroups gmane.comp.jakarta.pluto.user
Organization UW DoIT
Message-ID <[email protected]>
This is a portlet spec issue. The 1.0 portlet spec does not define a way 
to get behavior similar to ServletRequestAttributeListener. The fact 
that Pluto uses a cross-context call to a special servlet to initiate 
portlet rendering is an implementation detail that cannot be relied upon 
when writing a 'portlet'. However if you have a 
ServletRequestAttributeListener in the web.xml for your portlet 
application and directly target a servlet of your own your listener 
should be triggered.

-Eric

michael freedman wrote:
> Seems that in at least Pluto 1.x, if you register a 
> ServletRequestAttributeListener with your web application you are 
> never called because Pluto relies on cross context dispatching -- 
> These listeners are maintained in the servletContext hence with cross 
> context there are two involved (pluto's and the portlet app).  In this 
> case we run into a mismatch where Pluto's context/listeners are used 
> rather and the portlet apps.  I.e. The request is received/managed by 
> the Pluto context (the one that doesn't have the apps listeners 
> registered -- context is transferred to the portlet app and the 
> portlet app removed the request attribute, the removal is actually 
> handled by the request instance in the Pluto context and hence the 
> Pluto listeners are called not the portlet app.
>
> Anyone ever figure a way around this?  Or is this one of those 
> (generic) servlet gotchas related to cross context?
>   -Mike-
smime.p7s (application/x-pkcs7-signature, 3.3 KB) - not displayed