Pages

Friday, April 16, 2010

It happened again !

Okay, some reminder for the future. I don't know how many simple tapestry project I've made, but definitely more than a few. Yet i keep falling into the same hole. I keep missing some minor detail when creating a new project. And this time I'm facing a weird problem.

My project run fine in my development environment (eclipse WTP, tomcat, windows). But when ever i deploy it to my linux server. The page didn't show , it keep getting exception :

Page xxx did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.
 First I thought it was Case Sensitive problem. The name of the template (.tml) didn't match up to the class page. Although tapestry is case insensitive in many other things unfortunately this is something that T5 couldn't control. To bad that wasn't the problem :(

And then when i try to rebuild my project, clean, rebuild the class, and refreshing the project tree on eclipse explorer. You need to refresh the tree to make sure new/old/deleted file in the project will be the same with the wtp tomcat temp folder. The temp folder usually located in :
<your_workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmpX
 After rebuilding I found out that my local project also has the same problem, so it isn't about case sensitive. It turn out the source of my problem is this :

<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
while the correct one is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
Tapestry 5 could be very strict about this stuff, and no IDE support for Tapestry 5 certainly didn't help :( There are times when i build the html page from scratch just to test simple case, i forgot to ade the xmlns and Tapestry would just sprout some error.

It's a great framework no doubt. Years in front of its competitor. But it has its own perks *meh* Hope this can be a gentle reminder for me in the future.

~FD

No comments: