You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Michael Courcy <mi...@gmail.com> on 2007/11/04 22:48:06 UTC

How to contribute a new Request Handler

Hi

I'm  really new to tapestry, and I was trying to contribute a new 
request Handler

So I follow the documentation and the example provided by the archetype

first I provide a builder for my RequestHandlerService :

public RequestFilter buildMichaelFilter(final Logger log){
        return new RequestFilter(){

            public boolean service(Request request, Response response, 
RequestHandler requestHandler) throws IOException {
                try{
                    log.info("Mic before");
                    return requestHandler.service(request, response);
                }finally{
                    log.info("Mic after");
                }
            }
           
        };
    }


And then I contribute it :

public void contributeRequestHandler(OrderedConfiguration<RequestFilter> 
configuration,           
            @InjectService("MichaelFilter")
            RequestFilter michaelFilter,
            @InjectService("TimingFilter")
            RequestFilter timingFilter
            )
    {
        // Each contribution to an ordered configuration has a name, 
When necessary, you may
        // set constraints to precisely control the invocation order of 
the contributed filter
        // within the pipeline.       
       
        configuration.add("Michael", michaelFilter);
        configuration.add("Timing", timingFilter);
       
    }

And nothing is logged from the michaelFilter ... while the timingFilter 
keep on working like before.

I probably misunderstood something.

Any idea ?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org