You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Net Dawg <ne...@yahoo.com.INVALID> on 2014/06/25 10:58:36 UTC

Preload All Pages On Startup

On server startup, what is the best way to preload all *.tml under [...]resources[...]pages?    With all defaults - locale, etc.  


In other words, how are tapestry (5.3.x) pages mapped to servlets so that something like this may be attempted in web.xml?



     <servlet>
       <servlet-name>Employees</servlet-name>
       <display-name>Employees</display-name>
       <servlet-class> org.apache.tapestry.ApplicationServlet</servlet-class> 
       <load-on-startup>2</load-on-startup>
     </servlet>

Re: Preload All Pages On Startup

Posted by Dmitry Gusev <dm...@gmail.com>.
You can try this:

@Inject private ComponentClassResolver componentClassResolver;

@Inject private ComponentSource componentSource;


// then if your code:


    List<String> pageNames = componentClassResolver.getPageNames();

    for (String pageName : pageNames)

    {

        componentSource.getPage(pageName);

    }





On Wed, Jun 25, 2014 at 12:58 PM, Net Dawg <ne...@yahoo.com.invalid>
wrote:

> On server startup, what is the best way to preload all *.tml under
> [...]resources[...]pages?    With all defaults - locale, etc.
>
>
> In other words, how are tapestry (5.3.x) pages mapped to servlets so that
> something like this may be attempted in web.xml?
>
>
>
>      <servlet>
>        <servlet-name>Employees</servlet-name>
>        <display-name>Employees</display-name>
>        <servlet-class>
> org.apache.tapestry.ApplicationServlet</servlet-class>
>        <load-on-startup>2</load-on-startup>
>      </servlet>




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com

Re: Preload All Pages On Startup

Posted by Daniel Jue <te...@gmail.com>.
Just wanted to comment that I do the same thing at startup and look at
annotations attached to the pages, and construct menu items for the pages
which have the right kind of annotation.  The annotation I made also has a
parameter fir the type of page, so the menu items get a corresponding
icon.  :-)
On Jun 25, 2014 7:49 AM, "Thiago H de Paula Figueiredo" <th...@gmail.com>
wrote:

> On Wed, 25 Jun 2014 05:58:36 -0300, Net Dawg <ne...@yahoo.com.invalid>
> wrote:
>
>  On server startup, what is the best way to preload all *.tml under
>> [...]resources[...]pages?    With all defaults - locale, etc.
>>
>
> Templates themselves are tightly tied to their class counterparts, so
> preloading just templates wouldn't make a difference. Dmitry's solution
> should work for preloading classes and templats.
>
>  In other words, how are tapestry (5.3.x) pages mapped to servlets so that
>> something like this may be attempted in web.xml?
>>
>
> Tapestry doesn't map pages to servlets. Tapestry isn't implemented as a
> servlet, but as a servlet filter, so every request passes through it, even
> when Tapestry itself doesn't generate the response.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Preload All Pages On Startup

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 25 Jun 2014 05:58:36 -0300, Net Dawg <ne...@yahoo.com.invalid>  
wrote:

> On server startup, what is the best way to preload all *.tml under  
> [...]resources[...]pages?    With all defaults - locale, etc.

Templates themselves are tightly tied to their class counterparts, so  
preloading just templates wouldn't make a difference. Dmitry's solution  
should work for preloading classes and templats.

> In other words, how are tapestry (5.3.x) pages mapped to servlets so  
> that something like this may be attempted in web.xml?

Tapestry doesn't map pages to servlets. Tapestry isn't implemented as a  
servlet, but as a servlet filter, so every request passes through it, even  
when Tapestry itself doesn't generate the response.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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