Women in Technology

Hear us Roar



Article:
  Two Servlet Filters Every Web Application Should Have
Subject:   Bug with weblogic 8.1 ?
Date:   2004-01-06 04:57:16
From:   anonymous2
Hello, I'd like to use the GZIPFilter on a webapp that will run on Weblogic 8.1 SP1.


My app works fine with the filter (latest sources from www.jspbook.com) but fails when deployed on weblogic: browser (IE or Mozilla) displays some binary content. Using mozilla to get HTTP headers, I can see that content-length for the login page is 2602 bytes long on Tomcat (all works fine) and only 869 bytes on weblogic.


Does anyone have any idea what is wrong ?


Nico (ndeloof@capgemini.fr)

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • Bug with weblogic 8.1 ?
    2004-01-07 02:32:44  anonymous2 [View]

    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");

    ...
    • 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.
  • Bug with weblogic 8.1 ?
    2004-01-06 12:44:27  anonymous2 [View]

    just curious, how do you use mozilla to get response header?
    • Bug with weblogic 8.1 ?
      2004-01-07 00:20:09  anonymous2 [View]

      Tools > Web development > Live HTTP Headers

      http://extensionroom.mozdev.org/more-info.php/livehttpheaders