All,
I am writing a portlet filter:
MyFilter implements RenderFilter { ... }
First issue: within the filter, I want to intercept the output of:
filterChain.doFilter()
So I pass dofilter() an instance of RenderResponseWrapper:
filterChain.doFilter(renderRequest, myRenderResponseWrapper)
Here is the first problem. If my filter applies to a portlet that just writes content out, I am able to intercept the output.
However, if my filter applies to a portlet that forwards or includes a JSP, no method of my RenderResponseWrapper is called, except maybe getResponse().
This seems wrong: it seems that whatever way the filtered portlet decide to produce its output, it shouldn't bypass the filter. Or did I miss something?
Second, still within the filter, in the case where I obtain content, I want to forward or include the request further to a servlet.
So I do:
dispatcher = portletContext.getRequestDispatcher("/foobar")
then:
dispatcher.forward(renderRequest, myRenderResponseWrapper2)
Same issue here: no method is called on myRenderResponseWrapper2, and I cannot intercept the output produced by my servlet.
So in both cases, it seems that whenever there is an include or forward anywhere within filtered resources, those bypass the response object that is passed.
Now my expectation was that this should work. Is this a bug, a feature, or am I doing something wrong?
-Erik
Please sign in to flag this as inappropriate.