| 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.
|
||
Showing messages 1 through 5 of 5.
-
Bug with weblogic 8.1 ?
2004-01-07 02:32:44 anonymous2 [View]
-
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.



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