Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

Saturday, February 24, 2007

Updated Tapestry Tutorial

I've updated the Tapestry 5 Tutorial, adding chapter 3, which is about the basics (including ActionLink). I may need to trim down some of the theoreticals, it's a bit verbose.

Tapestry 5.0.2 is ready to be announced on monday; one of the last things in was a renewed Exception Report page, including the return of line precise exception reporting. I've gotten better at design layout & CSS (though still pretty lame) but the results are looking good (you can seen a screenshot of the exception report page in the tutorial).


David said...

The exception page looks very good, but, there seems to be a lot of repeated information.

I often found with Tapestry 4 exception pages that you have a to dig through a lot of text to find the core reason behind a problem. It's often not at the top of the page.

Is there anything you can do to cut out some of the unnecessary verbosity / repetition / detail?

Howard said...

Well, with just a little bit of work, I could get it to only display the file content once, even if the same location shows up in multiple exceptions.

Displaying the whole stack is important, because I think that each layer adds some global context and removes some local context. That is, the upper exceptions answer the question "why?" and the lower exceptions answer the question "what?".

I have been thinking of adding a kind of label code to exceptions that could turn into a longer text/html description of the problem and solution.

TestBlog said...

Is this me or is there a problem with the pom?

[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 14,column 22] : ${tapestry-release-version} is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 90,column 26] : ${tapestry-release-version} is not a valid reference.

Howard said...

It's a warning that you ignore. It's just a conflict between how the generate pom.xml deals with ${xxx} constructs, and how the pom.xml-as-template-for-archetype deals with it. No problems.

Vlajbert said...

Hey Howard,
When I do a add dependency for Maven I don't see a tapestry-core. I see all the other tapestry packages, just not core. Any ideas?

Howard said...

You'll probably need to edit the pom.xml by hand. The Maven eclipse plugin is extremely flakey about adding dependencies, but does a fine job of reading an existing pom.

Robert said...

Hi Howard, just going through the tutorial and am getting Element <t:if> is in the Tapestry namespace, but is not a recognized Tapestry template element. errors. Looking at the T5 schema there are no elements other than "comp" - is this right?

ps great exception handling!

Howard said...

The tutorial now represents release 5.0.3, which is available as a snapshot. The current code in the Maven repository is 5.0.2. I did some significant changes to templates after 5.0.2. So <t:if> will work in 5.0.3, but in the meantime you use <t:comp type="if"> or <span t:type="if">.

robert said...

Thanks Howard, I've installed the 5.0.3 snapshot from head and the tutorial works fine.

Michael said...

Hello Howard,
this tutorial is really helpful. After years of developing webapps in cocoon, struts and spring mvc I've the feeling tapestry 5 is the edge in web development (Session handling, Exception log, ... WOW!). Thank you for this wonderful piece of code and your eloquent and brain friendly delineation.

Howard said...

Thanks! I've just about finished converting the tutorial to Maven APT format (i.e., simple HTML, not PDF). That'll make it easier for other members of the team to help going forward. I'm about to start in with basic forms.

Jacques said...

Thanks Howard,

I have the mission to find the best template engine for our web apps. I found out that Tapestry 5 might help us move away from all those JSP files we are currently managing.

I'm new to Java and your tutorial is my only lifeline to Tapestry.

I'm currently using Tapestry 5.0.5 and found out some issues with the Tutorial. The:

private int _target;

Gave me the error:

java.lang.Error: Unresolved compilation problem: Persist cannot be resolved to a type

I was able to resolve this by using Eclipse to generate a @Persist type.

Would it be possible for you to update this tutorial?