You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by xieweiguo <xi...@139.com> on 2012/05/14 06:52:14 UTC
How to render component(zone,block) widthout request and response
Hello everybody!
I am using tapestry for a comet app.now I have got a question:How to render
component(zone,block) widthout request and response?
When some event has bean fired from server(for example:somebody get
online),the server need to render some html and push it to all the people
who are online.Did any body Solved this problem?
Thank you!
hi,大家好!
我现在遇到了一个问题:在某些客户端保持长连接的应用中,服务器需要响应一些事件(有服务器触发的),渲染出一些组件的html,然后push到所有在线的客户端。这个时候,服务器如何渲染出这些组件的html(没有request和response,意味着不能使用tapestry的请求处理链)?
请打击明示,谢谢!
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-render-component-zone-block-widthout-request-and-response-tp5708658.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to render component(zone,block) widthout request and
response
Posted by xieweiguo <xi...@139.com>.
Thank you for your encouragement.I will post my code when i finished . ^_^
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-render-component-zone-block-widthout-request-and-response-tp5708658p5708920.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to render component(zone,block) widthout request and
response
Posted by Lance Java <la...@googlemail.com>.
> Thank you ! That's a way to solve my problem...
No problem, if you could share your code I would be interested to see your
solution since I'm doing something similar myself
> By the way,where are you from?
I'm australian but live in London, UK
> I am from china, and it's difficult to communicate width each other for my
> poor English.
Your english is fine, it's far better than my chinese ;)
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-render-component-zone-block-widthout-request-and-response-tp5708658p5708780.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to render component(zone,block) widthout request and
response
Posted by xieweiguo <xi...@139.com>.
Thank you ! That's a way to solve my problem...
By the way,where are you from ?I am from china,and it's difficult to
communicate width each other for my poor English.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-render-component-zone-block-widthout-request-and-response-tp5708658p5708740.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How to render component(zone,block) widthout request and
response
Posted by Lance Java <la...@googlemail.com>.
I just recently asked the same question on the list
http://tapestry.1045711.n5.nabble.com/tapestry-push-proof-of-concept-td5697644.html
here
The steps to do it are:
1. In the intital tapestry page request, use ComponentResources to generate
a Link to a component event (most likely without the context at this stage).
2. In your async event, append the event context to the URL (not entirely
sure how to do this yet, take a look at
ComponentResources.createEventLink(String eventType, Object... context)).
3. Instantiate a fake Request and Response (with OutputStream buffer) and
spoof them into RequestGlobals
4. Take a look at the code for TapestryFilter and copy it's behaviour to
process a request / response.
5. The HTML (and / or javascript) will be written to the fake response's
OutputStream
Cheers,
Lance.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/How-to-render-component-zone-block-widthout-request-and-response-tp5708658p5708703.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org