T5.2.6: Activate called twice
Hi List, I've never really used onActivate so I did not care about how often it would be called... up to today. I have a single onActivate(EventContext context) and corresponding onPassivate in my page class and use the context to load som data from the db. I suddenly realized that onActivate allways get's called twice. The first thing I have done to fix this, was double checking all my css/js/tml/java files for usage of relative URLs, as suggested by Thiago in this thread: http://tapestry.1045711.n5.nabble.com/t5-onActivate-called-twice-td2429079.html#a2429087 Without success Then I thought some unseen redirects could be the cause. I installed HTTP-Live Headers plugin in FF5 to observe the HTTP headers. No redirects sent. CSS-files and images are cached and the only GET-request for the page ittself is answered with HTTP OK. Where else could I look? Thanks in advance - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-6-Activate-called-twice-tp4690554p4690554.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.2.6: Activate called twice
Are you instantiating (injecting) the page somewhere? onActive is called called once when required, you have to tell more about your case if you want reasonable answers. Kalle On Thu, Aug 11, 2011 at 11:44 AM, nillehammer tapestry.nilleham...@winfonet.eu wrote: Hi List, I've never really used onActivate so I did not care about how often it would be called... up to today. I have a single onActivate(EventContext context) and corresponding onPassivate in my page class and use the context to load som data from the db. I suddenly realized that onActivate allways get's called twice. The first thing I have done to fix this, was double checking all my css/js/tml/java files for usage of relative URLs, as suggested by Thiago in this thread: http://tapestry.1045711.n5.nabble.com/t5-onActivate-called-twice-td2429079.html#a2429087 Without success Then I thought some unseen redirects could be the cause. I installed HTTP-Live Headers plugin in FF5 to observe the HTTP headers. No redirects sent. CSS-files and images are cached and the only GET-request for the page ittself is answered with HTTP OK. Where else could I look? Thanks in advance - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-6-Activate-called-twice-tp4690554p4690554.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.2.6: Activate called twice
On Thu, 11 Aug 2011 15:44:51 -0300, nillehammer tapestry.nilleham...@winfonet.eu wrote: Hi List, Hi! I suddenly realized that onActivate allways get's called twice. Have you checked what context values does onActivate() get in these two requests? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, 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
Re: T5.2.6: Activate called twice
This is almost always due to a bad img URL; the browser gets the URL, there's no actual file, it ends up invoking the Index page passing the bad path as activation context. On Thu, Aug 11, 2011 at 12:42 PM, Thiago H. de Paula Figueiredo thiag...@gmail.com wrote: On Thu, 11 Aug 2011 15:44:51 -0300, nillehammer tapestry.nilleham...@winfonet.eu wrote: Hi List, Hi! I suddenly realized that onActivate allways get's called twice. Have you checked what context values does onActivate() get in these two requests? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, 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 -- Howard M. Lewis Ship Creator of Apache Tapestry The source for Tapestry training, mentoring and support. Contact me to learn how I can get you up and productive in Tapestry fast! (971) 678-5210 http://howardlewisship.com - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.2.6: Activate called twice
Hi guys, Thanks for the replies. In fact I had some img tags with no src-attribute as a placeholder for the designers to deliver their content. I replaced them now with properly styled divs. Although what was strange, they were on totally different pages. So I could not imagine them being the reason for such trouble. And indeed they did not cause the trouble. In fact my activate method IS just called ONCE. I somehow managed to misconfigure my logging system in a way that every message gets logged twice. I was fooled by that. I checked by replacing the log statements with ordinary System.out.printlns and tadaa everythin works as expected. Now for the logging configuration... but I wouldn't dare to badger you with that... - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-6-Activate-called-twice-tp4690554p4691473.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5.2.6: Activate called twice
Just for the records: NEVER do that: log4j.rootCategory=info, A1 That will cause every message to be logged twice. I had managed that by misconfiguring maven resource filtering... - http://www.winfonet.eu -- View this message in context: http://tapestry.1045711.n5.nabble.com/T5-2-6-Activate-called-twice-tp4690554p4691543.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org