more on servlet filters...

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

more on servlet filters...
Since my last letter I've done some more investigating of the API and combined with google searches was able to cobble together the following code.

********************code below

initialize server, get context

 System.out.println("just before defining authorization filter code block, http context.");
             //Instantiate a new webapplicationhandler
   WebApplicationHandler whandler = new WebApplicationHandler();
             //Instantiate a filter holder
             FilterHolder fholder = whandler.defineFilter("authfilter",AuthorizationFilter.class.getName());
             //add the filterholder to the webapp handler after defining it for the authorization filter.
             //Map context path to the filter
             //add the webapphandler to the existing server context
              System.out.println("just after adding authorization filter handler to context, http context.");

define servlet handler, add servlets, define resource handler, start server
*****************code above

The code compiles fine, however the Filter is apparently not being called on the requests as standard out trace calls placed in the "doFilter()" are never triggered. Is there yet another initialization/configuration call that I need to have in that block to make it work? Is there a problem with adding the ServletHandler and Resource handlers after the WebContextHandler to the context? I am hoping I am just missing some call somewhere (it took me long enough to figure out the whole defineFilter/Dispatch idea!)

Any help that can be provided would be greatly appreciated.



Revolutionize the way you surf the Web!
Try NetZero HiSpeed 3G.
Visit to sign up today!

This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more.
jetty-discuss mailing list
[hidden email]