(Answering again as I accidently hit the send button)

On Thu, 01 Apr 2010 10:50:44 -0300, Dmitry Gusev <dmitry.gu...@gmail.com> wrote:

I don't like Dispatcher approach in one reason: using Dispatchers I will
have to route incoming requests myself

That's right.

and pick (instantiate?) concrete task handler

If you declare your dispatcher as a Tapestry-IoC service, you can inject whatever you want.

(and, maybe, manage their state?).

Task handlers tend to be stateless. If you want to handle @SessionState objects, use the ApplicationStateManager service.

In this case using pages is preferred for me.

Point taken. :)

However I also refused to return StreamResponse from onActivate, since
keeping onActivate simple is a good approach I think.

Maybe Tapestry itself could have some return type or value that means that the page doesn't generate a response.

For now I ended up with the following:

1. I declared custom metadata symbol (I named it NO_MARKUP) and annotated
all task handler pages with this metadata.
2. I contributed markupRenderer as a first renderer in chain and in there
I'm checking if page class contatins declared annotation. If it presents, I simply return "<html></html>" as a response.

Nice solution! :)

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

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

Reply via email to