Hi Christian,

Thanks for pointing me to the fact, that one can specify more than one 
constraint. I have completely missed that (Should have taken a closer look to 
the signature of the add-method;-)) ). In fact your suggestion solved my 
problem.
Kind regards and sleep well, nillehammer

==
http://www.winfonet.eu

----- original Nachricht --------

Betreff: Re: [T5.1] How to break the chain in MasterDispatcher
Gesendet: Fr, 05. Jun 2009
Von: Christian Senk<senk.christ...@googlemail.com>

> Hi nille,
> 
> i got the same problem. This part isn't good documented, look at this 
> snippet from the TapestryModule:
> 
>     /**
>      * The MasterDispatcher is a chain-of-command of individual Dispatchers,
> each handling (like a servlet) a particular
>      * kind of incoming request. <dl> <dt>RootPath</dt> <dd>Renders the
> start page for the "/" request</dd>
>      * <dt>Asset</dt> <dd>Provides access to classpath assets</dd>
> <dt>VirtualAsset</dt> <dd>Provides access to combined
>      * scripts</dd> <dt>PageRender</dt> <dd>Identifies the {...@link
> org.apache.tapestry5.services.PageRenderRequestParameters}
>      * and forwards onto {...@link PageRenderRequestHandler}</dd>
> <dt>ComponentEvent</dt> <dd>Identifies the {...@link
>      * ComponentEventRequestParameters} and forwards onto the {...@link
> ComponentEventRequestHandler}</dd> </dl>
>      */
>     public static void
> contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration)
>     {
>         // Looks for the root path and renders the start page. This is
> maintained for compatibility
>         // with earlier versions of Tapestry 5, it is recommended that an
> Index page be used instead.
> 
>         configuration.addInstance("RootPath", RootPathDispatcher.class,
> "before:Asset");
> 
>         // This goes first because an asset to be streamed may have an file
> extension, such as
>         // ".html", that will confuse the later dispatchers.
> 
>         configuration.addInstance("Asset", AssetDispatcher.class,
> "before:ComponentEvent");
> 
>         configuration.addInstance("VirtualAsset",
> VirtualAssetDispatcher.class, "before:Asset");
> 
>         configuration.addInstance("ComponentEvent",
> ComponentEventDispatcher.class, "before:PageRender");
> 
>         configuration.addInstance("PageRender",
> PageRenderDispatcher.class);
>     }
> 
> 
> I think you have to specify one more constraint to insert your 
> Dispatcher between the ComponentEvent and PageRender dispatcher.
> 
> configuration.add("LoginDispatcher", loginDispatcher,  "before:PageRender",
> "after:ComponentEvent");
> 
> Worked for me :)
> 
> 
> 
> nille hammer schrieb:
> > Hi List,
> >
> > I have implemented a LoginDispatcher like explained in the wiki
> (http://wiki.apache.org/tapestry/Tapestry5HowToCreateADispatcher). Then I
> contributed it to the MasterDispatcher's configuration with the following
> code:
> > configuration.add("LoginDispatcher", loginDispatcher, 
> "before:PageRender");
> >
> > So far so good. Everything works up to this point. If I got it right I
> would end up with a chain of Dispatchers in the following order: 
> "RootPath",  "Asset", "ComponentEvent", "LoginDispatcher",  "PageRender".
> Although "LoginDispatcher" is put after "Asset" I still see requests for
> Assets (i.e. /assets/xxx ) in my LoginDispatcher. I thought, this could not
> be the case as these requests should have been handeled by AssetDispatcher.
> What did I get/do wrong?
> >
> > Thanks in advance, nillehammer
> >
> > ==
> > http://www.winfonet.eu
> >
> >   
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
> 

--- original Nachricht Ende ----


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

Reply via email to