Hi Howard, I have found both ApplicationInitializer and ComponentSource only
available by injection within a page which is already instantiated. What I
was looking for is a way to create all pages (or even just one) before a
user request would hit.

Also, could you give just a little bit more detail about what you mean with
"perform a little bit of cleanup work"? What will it take for Tapestry to
make pages return to the pool and stay available until undeploy time? This
would also enable us to create a number of page objects per page and have
them pooled and ready for hits. Especially if a minimum of them aren't
garbage collected later.

For now, I would be more than happy with a semi-proper workaround. If write
something decent, I'll try to contribute it somewhere. 


Angelo Chen wrote:
> 
> Hi Howard,
> 
> The deplay happens before I refer to _userExists, just displaying the page
> takes a long time, you can see from the code below,  the _user field is
> referred to in onSuccess which is after the page display: 
> 
> @ApplicationState
>     private SessionData _user;
> 
>     private boolean _userExists;
> 
>     String onSuccess() {
>   
>    }
> 
> 
> Howard Lewis Ship wrote:
>> 
>> You can inject the ComponentSource into an ApplicationInitializer and
>> obtain
>> the page by name.  There's some other cleanup I can't research now.
>> 
>> It would be interesting to know exactly what is taking so long ... I
>> think
>> you may find it isn't until you reference your _user field that there's a
>> delay, partly to set up the many necessary services, but also to create
>> the
>> HttpSession, which can be time consuming in some servers.
>> 
>> On 9/13/07, Angelo Chen  wrote:
>>>
>>>
>>> Hi Howard,
>>>
>>> I'm quite ok with T5's speed when comes to page display first time, but
>>> it
>>> is really slow when a page contains :  @ApplicationState private
>>> SessionData
>>> _user; loaded first time. Is there a simple way to pre-load that page? 
>>> I
>>> know the page name, dont have to be generic.
>>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-init-T5-pages-on-deployment----1st-few-hits-would-be-faster-tf4437654.html#a12669632
Sent from the Tapestry - User mailing list archive at Nabble.com.

Reply via email to