NOTE: This is outdated information that applies primarily to Tapestry 4.

How to set up Eclipse/Callisto/Jetty for Developing Tapestry

Download and extract all of the following to a directory (I use C:\java\)

Edit your system environment PATH variable to include c:\java\apache-ant-1.6.5\bin

Open tapestry-4.0.2/config/build.properties and change the hivebuild.dir to the following:

hivebuild.dir=C:/java/hivemind-1.1.1/hivebuild

From a terminal window, cd to the c:\java\tapestry-4.0.2\framework directory and type the following:

C:\java\tapestry-4.0.2\framework>ant compile-dependencies

This will download Tapestry's supporting libraries..

Download the latest Eclipse http://www.eclipse.org (I'm using 3.2)

Install the Callisto plugins for eclipse

Install Jetty Launcher plugin

(Use Subversion)

(Mini-subversion-lesson: by convention, most people work out of the trunk folder, when they make a release, they copy the trunk to tags/release-1.0 for example and that remains a frozen release. Learn more at http://subversion.tigris.org/)

Note: Later when you want to deploy your app from the repository, you'll do first do an svn checkout(one time only) such as
svn co file:///usr/local/repository/myapp/trunk/context/ /home/myapp/www/ and every time you want to update your live version(after commiting changes from eclipse) simply do an svn update /home/myapp/www/ and then restart your jetty server. This is a great way to save yourself because you can very easily roll back to an earlier revision on the server if there was a problem.

Note: Edit the XML filetypes so that *.page, *.application, and *.jwc files open up in the XML editor

From the New project wizard...

C:\java\tapestry-4.0.2\*.jar
C:\java\tapestry-4.0.2\ext-package\lib\*.jar

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
        <display-name>
        udosquares</display-name>
        <servlet>
                <servlet-name>Udosquares</servlet-name>
                <servlet-class>
                        org.apache.tapestry.ApplicationServlet
                </servlet-class>
                <load-on-startup>1</load-on-startup>
        </servlet>

        <servlet-mapping>
                <servlet-name>Udosquares</servlet-name>
                <url-pattern>/app</url-pattern>
        </servlet-mapping>

</web-app>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN" 
        "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<application>
        
    <description>Udosquares Application File</description>
        
        <meta key="org.apache.tapestry.messages-encoding" value="UTF-8"/>
        <meta key="org.apache.tapestry.accepted-locales" value="en"/>
        
        <meta key="org.apache.tapestry.page-class-packages" value="com.udosquares.pages"/>
        <meta key="org.apache.tapestry.component-class-packages" value="com.udosquares.components"/>
</application>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>I love Tapestry</title>
</head>
<body>
Tapestry is awesome
</body>
</html>

Now for a tricky part that kinda threw me for a loop the first time.

package com.udosquares.pages;

import org.apache.tapestry.annotations.InitialValue;
import org.apache.tapestry.html.BasePage;

public abstract class Home extends BasePage {

        @InitialValue("literal:mike")
        public abstract void setName(String name);

}

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>I love Tapestry</title>
</head>
<body>
My name is <span jwcid="@Insert" value="ognl:name" />.
</body>
</html>

more later?? any pros are welcome to update this..after messing around a lot with other app servers and different setups I found this to be the most productive for tapestry work.

HowToSetupEclipseCallistoJetty (last edited 2011-01-02 02:23:02 by BobHarner)