Hi folks,
Short Question:
Is anyone aware of a mechanism to post-process a
servlet (without modifying its code) in Weblogic 5.1?
Details:
I am trying to do some custom post-processing to a third party application's servlet. The ideal tool would be a filter. Unfortunately, filters are implemented in WL5.1 (filters are a Servlet 2.3 feature and implemented WL6.1 onwards).
Chris Mathews pointed me to an excellent document on filters -
http://java.sun.com/products/servlet/Filters.pdf It mentions that "Many servlet and
JSP containers have introduced proprietary filter mechanisms, resulting in a gain ..." We are constrained for reasons to use WL5.1 and hence wanted to know if Weblogic had a custom implementation for that version.
Thinking Aloud:
Failing this, I was thinking of how we could do it without Weblogic support. We could write our own servlet (myServlet) which wraps the response object before passing it to the application servlet (appServlet). But, how will control return to myServlet? If we perform a dispatch, myServlet loses control. If we try an include, could we read the wrapped response object when it returns to myServlet? Are there any security/performance issues with this approach?
Warm regards,
Sharad Agarwal