This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
While Struts 1.X does not support servlet filters I found nothing on the web which said that struts and filters would not work. With Tomcat 5.1.15 and Struts 1.2.8 my webapp doesn't work when I configure a filter in web.xml. After the doFilter-method has finished nothing else happens and IE displays a blank page. The address line is correct and contains all parameters (Http-GET).
Is there something wrong with my configuration? Do I have to code a redirect within doFilter? Even putting loglevel to finest does not give any clues. All logfiles end at the point where the filter is used.
web.xml is like this:
It does not work with this mapping, neither:
struts-config.xml goes like this:
I would expect that after doFilter is done the ActionServlet is in control creating an instance of SomeForm and invoking SomeAction.execute. This does not happen. It works fine if the filter code is removed from web.xml.
I've used filters with Struts with JBoss/Tomcat and with Weblogic, so I know it is definitely possible. Lacking other information, at a guess I'd suspect something happening in the filter. Try creating a "do nothing" filter that just lets the request and response traffic flow through without taking any action, and just spit out a log message so you can see it taking place. In other words, the worlds silliest "hello world" filter. If that doesn't work, something strange must be going on.
Reid - SCJP2 (April 2002)
Joined: Feb 17, 2006
UR right. I did not focus on the filter class, cos I used it in other webapps and it worked. But for some reason the chain.doFilter statement was missing.
subject: Blank page returned when filters are used with struts