You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Szemere Szemere <sz...@googlemail.com> on 2008/11/07 14:29:49 UTC

[T5] Auto-load / Auto-request start page on Tapestry startup

Is there an easy way to have Tapestry auto-load or auto-request the start
page when the core Tapestry servlet loads up?

The first page to load when we restart Tapestry takes over 10seconds (mostly
because of Hibernate and number of linked pages), which we only get to when
making the first request from a browser.  A way to automate the first
request would be very useful, because it places the time cost outside of
user interaction.

Szemere

Re: [T5] Auto-load / Auto-request start page on Tapestry startup

Posted by Szemere Szemere <sz...@googlemail.com>.
Thanks for the suggestion, thought I couldn't get that quite to work. I'm on
Tapestry 5.0.11 and got the following. Upgraded to 5.0.15 to see if that
made any difference (a better error message ensues), but it hasn't done the
trick.

5.0.11
[INFO] Starting jetty 6.1.7 ...
2008-11-10 21:24:14.344::INFO:  jetty-6.1.7
2008-11-10 21:24:14.469::INFO:  No Transaction manager found - if your
webapp re
quires one, please configure one.
[ERROR] AppModule Contributing registry startup
[ERROR] AppModule Checking out pagePool
[ERROR] RegistryStartup [[missing key: startup-failure]]
[INFO] TapestryFilter Startup status:

Startup time: 93 ms to build IoC Registry, 1,015 ms overall.

Startup services status:
            ActionRenderResponseGenerator: VIRTUAL
         AjaxComponentEventRequestHandler: DEFINED

5.0.15
2008-11-10 22:01:10.861::INFO:  jetty-6.1.7
2008-11-10 22:01:10.02::INFO:  No Transaction manager found - if your webapp
req
uires one, please configure one.
[ERROR] AppModule Contributing registry startup
[ERROR] AppModule Checking out pagePool
[ERROR] RegistryStartup An exception occurred during startup: Could not
convert
'asset:context:design.css' into a component parameter binding: ja
va.lang.NullPointerException

Re: [T5] Auto-load / Auto-request start page on Tapestry startup

Posted by Hugo Palma <hu...@gmail.com>.
This is me thinking out loud, so this might not work at all because i
haven't tried it. But here's what my first go at this would be.
In the application module:

public static void contributeRegistryStartup(OrderedConfiguration<Runnable>
            configuration, @Inject @Value("${tapestry.start-page-name}")
final String startPageName, final PagePool pagePool) {
        configuration.add("StartPageLoad", new Runnable() {
            public void run() {
                pagePool.checkout(startPageName);
            }
        });
    }

Try this out, maybe it doesn't work but at least it's something to start
from.


On Fri, Nov 7, 2008 at 1:29 PM, Szemere Szemere <
szemereszemere@googlemail.com> wrote:

> Is there an easy way to have Tapestry auto-load or auto-request the start
> page when the core Tapestry servlet loads up?
>
> The first page to load when we restart Tapestry takes over 10seconds
> (mostly
> because of Hibernate and number of linked pages), which we only get to when
> making the first request from a browser.  A way to automate the first
> request would be very useful, because it places the time cost outside of
> user interaction.
>
> Szemere
>

Re: [T5] Auto-load / Auto-request start page on Tapestry startup

Posted by Szemere Szemere <sz...@googlemail.com>.
Thanks Howard. Works and goes a long way!  Saves about 70% of the start-up
time.

Szemere

Re: [T5] Auto-load / Auto-request start page on Tapestry startup

Posted by Howard Lewis Ship <hl...@gmail.com>.
This was noted by a couple of my clients during training.

Andy's solution is OK, except its hard to load a page sometimes when
there's no active request.

You can force the Hibernate to initialize early, which is 9 of your 10 seconds:

public void contributeRegistryStartup(OrderedConfiguration<Runnable>
configuration, final HibernateSessionSource sessionSource)
{
  configuration.add("HibernateStartup", new Runnable() { public void
run() { sessionSource.getConfiguration(); } });
}

On Fri, Nov 7, 2008 at 5:29 AM, Szemere Szemere
<sz...@googlemail.com> wrote:
> Is there an easy way to have Tapestry auto-load or auto-request the start
> page when the core Tapestry servlet loads up?
>
> The first page to load when we restart Tapestry takes over 10seconds (mostly
> because of Hibernate and number of linked pages), which we only get to when
> making the first request from a browser.  A way to automate the first
> request would be very useful, because it places the time cost outside of
> user interaction.
>
> Szemere
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: [T5] Auto-load / Auto-request start page on Tapestry startup

Posted by Andy Pahne <an...@googlemail.com>.

+1


Szemere Szemere schrieb:
> Is there an easy way to have Tapestry auto-load or auto-request the start
> page when the core Tapestry servlet loads up?
>
> The first page to load when we restart Tapestry takes over 10seconds (mostly
> because of Hibernate and number of linked pages), which we only get to when
> making the first request from a browser.  A way to automate the first
> request would be very useful, because it places the time cost outside of
> user interaction.
>
> Szemere
>
>   


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