aspose file tools*
The moose likes Struts and the fly likes Blank page returned when filters are used with struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Blank page returned when filters are used with struts" Watch "Blank page returned when filters are used with struts" New topic
Author

Blank page returned when filters are used with struts

Janin Bonn
Greenhorn

Joined: Feb 17, 2006
Posts: 2
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.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
It should be possible to use a filter in a Struts application. Could you show us your doFilter() method?


Merrill
Consultant, Sima Solutions
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
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)
Janin Bonn
Greenhorn

Joined: Feb 17, 2006
Posts: 2
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.

Thanks anyway.
 
jQuery in Action, 2nd edition
 
subject: Blank page returned when filters are used with struts