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.
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.");
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 http://www.netzero.com to sign up today!