Re: Preload All Pages On Startup

2014-06-25 Thread Dmitry Gusev
You can try this:

@Inject private ComponentClassResolver componentClassResolver;

@Inject private ComponentSource componentSource;


// then if your code:


ListString pageNames = componentClassResolver.getPageNames();

for (String pageName : pageNames)

{

componentSource.getPage(pageName);

}





On Wed, Jun 25, 2014 at 12:58 PM, Net Dawg net.d...@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-nameEmployees/servlet-name
display-nameEmployees/display-name
servlet-class
 org.apache.tapestry.ApplicationServlet/servlet-class
load-on-startup2/load-on-startup
  /servlet




-- 
Dmitry Gusev

AnjLab Team
http://anjlab.com


Re: Preload All Pages On Startup

2014-06-25 Thread Thiago H de Paula Figueiredo
On Wed, 25 Jun 2014 05:58:36 -0300, Net Dawg net.d...@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-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: Preload All Pages On Startup

2014-06-25 Thread Daniel Jue
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 thiag...@gmail.com
wrote:

 On Wed, 25 Jun 2014 05:58:36 -0300, Net Dawg net.d...@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-unsubscr...@tapestry.apache.org
 For additional commands, e-mail: users-h...@tapestry.apache.org