You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sascha Schaefer <Sa...@ebcsoft.de> on 2012/03/23 12:43:13 UTC

Load persistent data twice

Hello,

maybe you can help us with the following problem.
We are using Tapestry 4.0.2 for our web application where each of the web pages overrides the org.apache.tapestry.event.PageValidateListener#pageValidate(org.apache.tapestry.event.PageEvent) method to load necessary data from the database and prepares that data to be displayed. We noticed that this method is always called twice (because of 2 rendering cycles) which is not really necessary but uses a lot of extra time and resources until the page is finally displayed to the user.

Can you give any advice here what to do about it?
Thanks a lot for help!
Sascha Schäfer

Re: Load persistent data twice

Posted by Muhammad Gelbana <m....@gmail.com>.
I never used tapestry 4 but I guarantee that if you migrate to tapestry 5,
you won't regret, and you will definitely get prompt and efficient help on
this list :)

On Fri, Mar 23, 2012 at 1:43 PM, Sascha Schaefer <Sascha.Schaefer@ebcsoft.de
> wrote:

> Hello,
>
> maybe you can help us with the following problem.
> We are using Tapestry 4.0.2 for our web application where each of the web
> pages overrides the
> org.apache.tapestry.event.PageValidateListener#pageValidate(org.apache.tapestry.event.PageEvent)
> method to load necessary data from the database and prepares that data to
> be displayed. We noticed that this method is always called twice (because
> of 2 rendering cycles) which is not really necessary but uses a lot of
> extra time and resources until the page is finally displayed to the user.
>
> Can you give any advice here what to do about it?
> Thanks a lot for help!
> Sascha Schäfer
>



-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

Re: how we can use HttpOnly in Tapestry

Posted by Bob Harner <bo...@gmail.com>.
I agree with Howard, the question should be much more specific.

But I guess you're asking whether Tapestry has an API to make it easy
to set the HttpOnly flag in cookies sent to the browser. That's an
interesting topic that I wanted the answer to myself.

No, it doesn't. Tapestry's Cookie API
(http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Cookies.html)
is only a very simple façade in front of javax.servlet.http.Cookie and
doesn't support the newer setHttpOnly() method. It also can't specify
the secure flag per TAP5-47, can't set a cookie having a
domain+path+max-age combination per TAP5-1394/TAP5-1858, and can't
delete a session cookie having a domain.

As a work-around, you could use
org.apache.tapestry5.services.Response, like this:

	@Inject
	private Response response;
	....
	void afterRender() {
		response.setHeader("SET-COOKIE", "foo=bar; path=/; HttpOnly");
	}


Finally, if you own the app server then you may be able to configure
it to automatically set the HttpOnly flag in server-originated
cookies. For more info, just do a web search for something like:
HttpOnly Tomcat

On Tue, Mar 27, 2012 at 12:07 PM, Howard Lewis Ship <hl...@gmail.com> wrote:
> http://catb.org/esr/faqs/smart-questions.html
>
> On Mon, Mar 26, 2012 at 11:20 PM, Athneria, Mahendra
> <ma...@atos.net> wrote:
>> Can someone tell me the example how we can use HttpOnly in tapestry?
>>
>> Regards,
>> Mahendra

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


Re: how we can use HttpOnly in Tapestry

Posted by Howard Lewis Ship <hl...@gmail.com>.
http://catb.org/esr/faqs/smart-questions.html

On Mon, Mar 26, 2012 at 11:20 PM, Athneria, Mahendra
<ma...@atos.net> wrote:
> Can someone tell me the example how we can use HttpOnly in tapestry?
>
> Regards,
> Mahendra
>
>
>
> This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


how we can use HttpOnly in Tapestry

Posted by "Athneria, Mahendra" <ma...@atos.net>.
Can someone tell me the example how we can use HttpOnly in tapestry?

Regards,
Mahendra



This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos group liability cannot be triggered for the message content. Although the sender endeavors to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.


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


Re: Load persistent data twice

Posted by Jonathan Barker <jo...@gmail.com>.
If you are talking about form submission, where there is a rewind
phase, then I do recall being able to check whether the cycle was
rewinding... like cycle.isRewinding()... It's been a while....

On Fri, Mar 23, 2012 at 7:43 AM, Sascha Schaefer
<Sa...@ebcsoft.de> wrote:
> Hello,
>
> maybe you can help us with the following problem.
> We are using Tapestry 4.0.2 for our web application where each of the web pages overrides the org.apache.tapestry.event.PageValidateListener#pageValidate(org.apache.tapestry.event.PageEvent) method to load necessary data from the database and prepares that data to be displayed. We noticed that this method is always called twice (because of 2 rendering cycles) which is not really necessary but uses a lot of extra time and resources until the page is finally displayed to the user.
>
> Can you give any advice here what to do about it?
> Thanks a lot for help!
> Sascha Schäfer



-- 
Jonathan Barker
ITStrategic

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