Re: Installing Filters

On Fri, 14 Jan 2000, CAMERON, CRAIG wrote:

> I've made minor changes to HeaderFilter.java:
> 	public class CCPPFilter extends ResourceFilter {..
> AND
> 	try {
> 	    c = Class.forName("org.w3c.jigsaw.filters.CCPPFilter");
> 	} catch (Exception ex) {
> 	    ex.printStackTrace();
> 	    System.exit(1);
> 	}
> 
> ie effectively renamed the filter to test if I could work out how to add in
> a filter.  I couldn't.
> 
> 1)Compiled & placed CCPPFilter.class into Jigsaw.zip (no compression) with
> correct path
> 	-> didn't show up as option in jigadmin
> 2)Modified w3c.www.protocol.http.filters=w3c.www.jigsaw.filters.CCPPFilter

You mean
org.w3c.www.protocol.http.filters=org.w3c.www.jigsaw.filters.CCPPFilter :)

> 	-> crashed server on startup:
> 		Error initializing prop filters:
> 		Couldn't initialize[org.w3c.jigsaw.filters.CCPPFilter]: null
> 		java.land.ClassCastException
> 			at
> org.w3c.www.protocol.http.HttpManager.getManager.....
> 3)Wondered why adding HeaderFilter in jigadmin didn't change server config
> file
> 4)Reread ResourceFilter tutorial: wondered why when adding frame, CCPPFilter
> doesn't show up.
> 
> Please help :-)

In fact, you want to add a Client-Side filter, not a resource ServerSide
filter.
An exemple of Client-Side filter is org.w3c.www.protocol.http.DebugFilter
It extends PropRequestFilter and not ResourceFilter. As it is a
client-side filter and the client side may be reused to replace the HTTP
stack of any java based application.
Note that it has another filter method exceptionFilter, used in
org.w3c.www.protocol.http.proxy.ProxyDispatcher

But, if you want to add a filter on the server and not on the client part
of the proxy, you should add a server side filter to the root resource
(if you want it to affect the whole tree of resources).
See http://www.w3.org/Jigsaw/Doc/Programmer/writing-filters.html
Installing the Filter
Or see the example of
http://www.w3.org/Jigsaw/Doc/User/authentication.html
and http://www.w3.org/Jigsaw/Doc/User/JigAdmin/edit.html
Depending on the admin GUI you are using.
Hope this helps,

      /\ - Yves Lafon - World Wide Web Consortium -
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    

Received on Friday, 14 January 2000 05:30:29 UTC