I've got a simple example project going with annotations. Still includes the .page and .jwc files, although there isn't anything in them except for the page or component class name (haven't got the org.apache.tapestry.page-class-packages) to work yet, though

Here's the link to the project
http://www.realsolve.co.uk/site/tech/tapestry/tapestry4.zip

Cheers,
Phil



Scott F. Walter wrote:

Lukasz Kucharski wrote:

Hi there.
Does anybody know where to find good examples on annotations in T 4.0.
This new feature looks so attractive to me. I just wish I could simply
get rid of .page files and mantain code of my page only in two files
.java and .html. But it would be great if I could look at a few good
examples before I start rewriting my current app.

Thanks

I have been workign with a brand new sandbox app so I can test out the new 4.0 functionality before I migrate my applications, you may want to do this in case there is a bug in the first beta and you don't get frustrated. In terms of annotations, I've found they are best documented new feature, take a look at http://jakarta.apache.org/tapestry/tapestry-annotations/index.html. I have been playing around with nnotations and they are pretty solid, although I have found a couple of issues. FYI--I can't create a component without a .jwc because of a bug.

Here is how to have a page without a .page file

1. Setup your .application file to have a page search path, below is my file

<?xml version="1.0"?>

<!DOCTYPE application PUBLIC
 "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
 "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd";>
  <application name="Tapestry Component Workbench">
 <meta key="org.apache.tapestry.template-encoding" value="ISO-8859-1"/>
<meta key="org.apache.tapestry.page-class-packages" value="com.scottwalter.sandbox.tapestry4.pages"/> <meta key="org.apache.tapestry.component-class-packages" value="com.scottwalter.sandbox.tapestry4.components"/> <library id="contrib" specification-path="/org/apache/tapestry/contrib/Contrib.library"/>

</application>

2. If you want to have a page called "Home", create a java class file named "Home.java" in one of the packages sepcified by "org.apache.tapestry.page-class-packages" in step 1.

3.  Create an html page called "Home.html"

4.  Success!!!


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to