Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   Bug with weblogic 8.1 ?
Date:   2004-01-07 02:32:44
From:   anonymous2
Response to: Bug with weblogic 8.1 ?

I found the error (weblogic bug ?):


My index.jsp forwards to another page (using struts tag) And Weblogic applies the servlet filter to this forward, so the resulting HTTP response is a gzipped gzip !


Does it looks like a Weblogic bug ? I don't know about servlet API spec about this, but tomcat (reference implementation) DOESN'T apply filter to internally forwarded contents.



I added this code to com.jspbook.GZIPFilter to make it work on Weblogic :


private final static String FLAG
= "com.jspbook.GZIPFilter.doFilter";


public void doFilter(
ServletRequest req,
ServletResponse res,
FilterChain chain)
throws IOException, ServletException {

if (req instanceof HttpServletRequest) {
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;


// Avoid filtering when forwarded from a previous filtered URI
if (request.getAttribute(FLAG) != null) {
chain.doFilter(request, response);
return;
}
request.setAttribute(FLAG, "true");


...

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Bug with weblogic 8.1 ?
    2007-07-22 23:53:33  ManfredJS [View]

    Hi,

    The same symptoms seem to occur under Websphere Application Server 6.1 on z/OS. Runs fine under WAS 5.1 on z/OS.

    The application also uses many forwards (using Struts tags), but if I would include the "avoid filtering code", what would be the use of the filter? I assume the most part of the application then wouldn't be filtered/compressed at all.

    Did you find another solution to this?

    Kind regards,
    Manfred
  • Bug with weblogic 8.1 ?
    2007-07-22 23:50:27  ManfredJS [View]

    Hi,

    The same symptoms seem to occur under Websphere Application Server 6.1 on z/OS. Runs fine under WAS 5.1 on z/OS.