• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Blank page returned when filters are used with struts

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be possible to use a filter in a Struts application. Could you show us your doFilter() method?
 
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Janin Bonn
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic