Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filter that wraps a response with a header and footer

0 views
Skip to first unread message

Brian

unread,
Mar 31, 2003, 2:00:38 PM3/31/03
to

I have a Servlet Filter that is mapped to .html, .jsp and .do files. All it does
is do an include of header.jsp and footer.jsp in the correct locations so I can
brand my site consistently without having to edit all of my content files. It
works perfectly in Tomcat 4.x.

I cannot get it to work with WLS7. The filters are deployed correctly and in
the DOS window, I get a slew of errors that start off with:

<Mar 31, 2003 12:49:53 PM CST> <Error> <HTTP> <101020> <[ServletContext(id=4506788,name=tums,context-path=/tums)]
Servlet failed wit
h Exception
java.lang.StackOverflowError
at java.util.Properties.getProperty(Properties.java:473)
at java.lang.System.getProperty(System.java:557)
at sun.security.action.GetPropertyAction.run(GetPropertyAction.java:64)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.PrintWriter.<init>(PrintWriter.java:70)
at java.io.PrintWriter.<init>(PrintWriter.java:55)
at tums.wrappers.CharResponseWrapper.getWriter(CharResponseWrapper.java:20)
at tums.filters.HtmlFilter.doFilter(HtmlFilter.java:54)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:546)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:369)
at tums.filters.HtmlFilter.doFilter(HtmlFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:546)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:369)

And from there the last four lines repeat until the container kills it.

So, I have an endless recursive loop. My suspicion is that because the header
file is a jsp file, it tries to include itself over and over again. With Tomcat,
filters didn't apply to includes or forwards. It seems that they do with WLS7.

How do I get around this? I have Server Build:WebLogic Server 7.0 SP2 Sun Jan
26 23:09:32 PST 2003 234192 .

TIA,
-Brian

Brian

unread,
Apr 1, 2003, 2:18:49 PM4/1/03
to

I solved my problem. Instead of including header.jsp and footer.jsp, I included
header.inc and footer.inc and mapped the inc extension to the JSP servlet. Works
like a charm.

Thanks,
-Brian

0 new messages