Hit one of my first major hurdles for Tapestry 5 this morning: class reloading. Tapestry 5 periodically scans .class files to see if they have changed, and will clear caches and discard class loaders so that it can process the changes. I've finally gotten the code base to a point where I can demonstrate this and it works. And it's fast!
This is a huge productivity win: you change your classes and see the changes immediately. No restart, no redeploy. The same logic works for templates and other resources (you make the change, you see the change).
Speed is excellent; obviously, I have only a tiny fraction of Tapestry 5 implemented, and the page I'm using is very trivial (just a single component). However, even on my laptop, and with all debugging output enabled, refresh is instant.
By the way, here's my page template:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd"> <head> <title>First Tapestry 5 Page</title> </head> <body> <p> This is the <span style="color:green">First Tapestry 5 Page, ever!</span>. </p> <p> Output from HelloWorld component: <t:comp id="foo" type="HelloWorld"/> </p> </body>` </html>
And here's the HelloWorld component:
package org.apache.tapestry.integration.app1.components; import org.apache.tapestry.MarkupWriter; import org.apache.tapestry.annotations.ComponentClass; import org.apache.tapestry.annotations.RenderTag; @ComponentClass public class HelloWorld { @RenderTag void renderMessage(MarkupWriter writer) { writer.write("I Am HelloWorld"); } }
I need to do more experimentation; my environment is Eclipse 3.1.2 + Jetty (4) + JettyLauncher plugin. There's ample opportunity for the servlet container to screw us, in terms of their class loaders getting in the way (not showing file changes). Lots of people seem to use the Sydeo Tomcat plugin as well, so I need to check that.