[CONF] Apache Tapestry > Creating The Skeleton Application
Bob Harner edited the page: Creating The Skeleton Application Comment: Made images big enough to see ... Our final command line is: Code Block language text mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted. No Format $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3.7 Choose a number: 4: 4 Define value for
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Massimo Lusetti Changes (3) ... 2: 5.1.0.5 3: 5.2.6 4: 5.3.67 Choose a number: 4: 4 Define value for property 'groupId': : com.example ... Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.67 [INFO] [INFO] Parameter: groupId, Value: com.example ... / / / _ `/ _ \/ -_|_-/_/ \_,_/ .__/\__/___/\__/_/ \_, / // /_/ /___/ 5.3.67 (development mode) ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/joeuser/workspace. You may need to adjust a few things for other operating systems or local paths. Using the Quickstart Archetype From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted. $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3.7 Choose a number: 4: 4 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.7 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/joeuser/workspace/tutorial1/src/test/java [WARNING] Don't override file /Users/joeuser/workspace/tutorial1/src/main/webapp [WARNING] Don't override file /Users/joeuser/workspace/tutori
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (3) ... 5: 5.3.1 6: 5.3.2 7: 5.3.34 Choose a number: 7: 7 Define value for property 'groupId': : com.example ... Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.34 [INFO] [INFO] Parameter: groupId, Value: com.example ... / / / _ `/ _ \/ -_|_-/_/ \_,_/ .__/\__/___/\__/_/ \_, / // /_/ /___/ 5.3.34 (development mode) ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted. $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3 5: 5.3.1 6: 5.3.2 7: 5.3.4 Choose a number: 7: 7 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.4 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/java [WARNING] Don't override file /Users/hlship/Documents/workspace/tut
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Massimo Lusetti Changes (4) ... 4: 5.3 5: 5.3.1 6: 5.3.2 Choose a number: 5: 5 6: 6 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 ... Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.12 [INFO] [INFO] Parameter: groupId, Value: com.example ... / / / _ `/ _ \/ -_|_-/_/ \_,_/ .__/\__/___/\__/_/ \_, / // /_/ /___/ 5.3.12 (development mode) ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted. $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3 5: 5.3.1 6: 5.3.2 Choose a number: 6: 6 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.2 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/java [WARNING] Don'
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Massimo Lusetti Changes (4) ... 3: 5.2.6 4: 5.3 5: 5.3.1 Choose a number: 4: 4 5: 5 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 ... Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.1 [INFO] [INFO] Parameter: groupId, Value: com.example ... / / / _ `/ _ \/ -_|_-/_/ \_,_/ .__/\__/___/\__/_/ \_, / // /_/ /___/ 5.3.1 (development mode) ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.X Quickstart Project, enter the group id, artifact id, version and package when prompted. $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3 5: 5.3.1 Choose a number: 5: 5 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3.1 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/java [WARNING] Don't override
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (1) ... !startpage.png|border=1! !startpage.png|align=center,thumbnail! The date and time in the middle of the page proves that this is a live application. ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose the latest Tapestry 5.3 Quickstart Project, enter the group id, artifact id, version and package when prompted. $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] [INFO] [INFO] Building Maven Stub Project (No POM) 1 [INFO] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.0.19 2: 5.1.0.5 3: 5.2.6 4: 5.3 Choose a number: 4: 4 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/java [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/main/webapp [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/main/resources/com/example/tutorial [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/resources [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/conf [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/site [INFO] project created from Archetype in dir: /Users/hlship/Documents/workspace/tutorial1 [INFO]
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application File attached by Howard M. Lewis Ship startpage.png (74 kB image/png) Change Notification Preferences View Attachments
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Comment: Update for 5.3 Changes (37) ... {code} It will then prompt you to pick the archetype - choose the latest *Tapestry 5.X3 Quickstart Project*, enter the group id, artifact id, version and package when prompted. {noformat} ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] [INFO] Building Maven Default Stub Project (No POM) 1 [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] [INFO] >>> maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.1:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> org.apache.tapestry:quickstart (Tapestry 5.X 5 Quickstart Project) 2: http://tapestry.apache.org -> org.apache.tapestry:tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1 Choose version: 1: 5.1.0.5 5.0.19 2: 5.0.19 5.1.0.5 3: 5.2.46 4: 5.2.5 5.3 Choose a number: 4: 4 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: : Define value for property 'package': com.example: : com.example.tutorial Confirm properties configuration: groupId: com.example ... version: 1.0-SNAPSHOT package: com.example.tutorial Y: Y: : [INFO] [INFO] Using following parameters for creating project from Archetype: quickstart:5.3 [INFO] [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: packageInPathFormat, Value: com/example/tutorial [INFO] Parameter: package, Value: com.example.tutorial [INFO] Parameter: version, Value: 1.0-SNAPSHOT [INFO] Parameter: groupId, Value: com.example [INFO] Parameter: artifactId, Value: tutorial1 [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/java [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/main/webapp [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/main/resources/com/example/tutorial [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/resources [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/test/conf [WARNING] Don't override file /Users/hlship/Documents/workspace/tutorial1/src/site [INFO] project created from Archetype in dir: /Users/hlship/Documents/workspace/tutorial1 [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Total time: 22.398s [INFO] Finished at: Wed Jul 02 17:00:16 Tue Nov 22 11:46:08 PST 2011 [INFO] Final Memory: 16M/81M 7M/81M [INFO] ~/Documents/workspace ... {noformat} URLRewriter: TranslatorSource: DEFINED UpdateListenerHub: TypeCoercer: REAL URLEncoder: DEFINED UpdateListenerHub: DEFINED
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application File attached by Howard M. Lewis Ship startpage.png (75 kB image/png) Change Notification Preferences View Attachments
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Bob Harner Comment: Updated tapestry version number to 5.2.5 in the maven archetype command line Changes (3) ... {code} It will then prompt you to pick the archetype - choose *Tapestry 5.2.45 Quickstart Project*, enter the group id, artifact id, version and package when prompted. {noformat} ... [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.45 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 ... 1: 5.1.0.5 2: 5.0.19 3: 5.2.45 Choose a number: 3: 3 Define value for property 'groupId': : com.example ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.5 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.5 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.5 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (1) ... What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at {{/Users/Howard/Documents/workspace}}{footnote}Yes, /Users/Howard/Documents/workspace{footnote}Yes, Howard is on a Mac. Get one.{footnote}. You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.4 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.4 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.4 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml true http myProxyServer.com 8080 joeuser myPassword C:/Documents and Settings/joeuser/.m2/repository Of course, adjust the localRepository element to match the correct path for your computer. Running the New Application using Jetty One of the first things you
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (1) ... The date and time in the middle of the page proves that this is a live application. This is a complete little application; it doesn't do much, but it demonstrate how to create a number of pages sharing a common layout, and demonstrates some simple navigation. You can see that it has three different pages that share a common layout{footnote}Layout is a loose term meaning common look and feel and navigation across many or all of the pages of an application. Often an application will include a Layout component to provide that commonness.{footnote}. {warning} ... Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.4 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.4 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.4 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml true http myProxyServer.com 8080 joeuser myPassword C:/Documents and Settings/joeuser/.m2/repository Of course, adjust the localRepository element to match the correct path for your computer. Running the New Application
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (2) {tutorialnav} {scrollbar} h1. Using the Quickstart Archetype ... {display-footnotes} {tutorialnav} {scrollbar} Full Content Dependencies, Tools and Plugins Tapestry Tutorial Loading the Project Into Eclipse Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.4 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.4 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.4 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml true http myProxyServer.com 8080 joeuser myPassword C:/Documents and Settings/joeuser/.m2/repository Of course, adjust the localRepository element to match the correct path for your computer. Running the New Application using Jetty One of the first things you can do is use Maven to run Jetty directly. Change into the newly created directory, and execute the command: mvn jetty:run Again, the first time, there's a dizzying number of downloads, but before you know it, the Jetty servlet container is up and running. Once Jetty is initialized (which only takes a few seconds), you'll see the following in your console: URLRewriter: DEFIN
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (3) ... This is a complete little application; it doesn't do much, but it demonstrate how to create a number of pages sharing a common layout, and demonstrates some simple navigation. {warning} You should hit Control-C in the Terminal window to close down Jetty before continuing with the tutorial. {warning} {tutorialnav} Full Content Tapestry Tutorial Dependencies, Tools and PluginsCreating The Skeleton ApplicationLoading the Project Into EclipseExploring the ProjectHiloFormsForms2 Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.4 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.4 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.4 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml true http myProxyServer.com 8080 joeuser myPassword C:/Documents and Settings/joeuser/.m2/repository Of course, adjust the localRepository element to match the correct path for your computer. Running the New Application using Jetty One of the first things you can do is use Maven to run Jetty directly. Change into the newly created directory, and execute the command:
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (3) ... You should hit Control-C in the Terminal window to close down Jetty. h2. Investigating the Generated Artifacts Maven dictates the layout of the project: * Java source files under {{src/main/java}} * Web application files under {{src/main/webapp}} (including {{src/main/webapp/WEB-INF}}) * Java test sources under {{src/test/java}} * Non-code resources under {{src/main/resources}} and {{src/test/resources}} {info} Tapestry uses a number of non-code resources, such as template files and message catalogs, which will ultimately be packaged into the WAR file alongside the Java classes. {info} Let's look at what the archetype has created for us, starting with the web.xml configuration file: {code:title=src/main/webapp/WEB-INF/web.xml} PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> tutorial1 Tapestry 5 Application tapestry.app-package com.example.tutorial app org.apache.tapestry5.TapestryFilter app /* {code} This is short and sweet: you can see that the package name you provided earlier shows up as the {{tapestry.app-package}} context parameter; the TapestryFilter instance will use this information to locate the Java classes for pages and components. Tapestry 5 operates as a _servlet filter_ rather than as a traditional _servlet_. In this way, Tapestry has a chance to intercept all incoming requests, to determine which ones apply to Tapestry pages (or other resources). The net effect is that you don't have to maintain any additional configuration for Tapestry to operate, regardless of how many pages or components you add to your application. Tapestry pages minimally consist of an ordinary Java class plus a component template file. In the root of your web application, a page named "Index" will be used for any request that specifies no additional path after the context name.h3. Index Java Class The final piece of the puzzle is the Java class for the page. Tapestry has very specific rules for where page classes go. Remember the package name (configured inside web.xml)? Tapestry adds a sub-package, "pages", to it and the Java class goes there. Thus the full Java class name is org.apache.tapestry5.tutorial.pages.Index. {code:title=src/main/java/com/example/tutorial/pages/Index.java} package org.apache.tapestry5.tutorial.pages; import java.util.Date; /** * Start page of application tutorial1. */ public class Index { public Date getCurrentTime() { return new Date(); } } {code} That's pretty darn simple: No classes to extend, no interfaces to implement, just a very pure POJO (Plain Old Java Object). You do have to meet the Tapestry framework halfway: * You need to put the Java class in the expected package, org.apache.tapestry5.tutorial.pages * The class must be public * You need to make sure there's a public, no-arguments constructor (here, the Java compiler has silently provided one for us) As we saw when running the application, this page displays the current date and time. the {{currentTime}} property is where that value comes from; shortly we'll see how that value is extracted from the page and output. Tapestry always matches a page class to a template; neither is functional without the other. In fact, components within a page are treated the same way (except that components do not always have templates). You will often hear about the [Model-View-Controller pattern|http://en.wikipedia.org/wiki/Model_view_controller] (MVC). In Tapestry, the page class acts as both the Model (the source of data) and the controller (the logic that responds to user interaction). The template is the View in MVC. As a model, the page exposes JavaBeans properties that can be referenced in the template. Let's look at how the component template builds on the Java class to provide the full user interface. h3. Component Template Tapestry pages are the combination of a POJO Java class with a Tapestry component template. The has the same name as the Java class, but has the extension {{.tml}}. Since the Java class here is com.example.tutorial.pages.Index, the template file will be located at src/main/resource/com/example/tutorial/pages/Index.tml. Ultimately, both the Java class and the component template file will be stored in the same folder within the deployed WAR. Tapestry component templates are well-formed XML documents. This means that you can use any available XML editor. Templates may even have a DOCTYPE or an XML schema to validate the structure of the template. {note} Tapestry parses component templates using a non-validating parser;
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (9) {tutorialnav} {info} This chapter may look long, but almost all of it is one-time setup for Maven and Eclipse. The actual Tapestry part is really small and simple. We will shortly be splitting it into two chapters. {info} h1. Using the Quickstart Archetype Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: *archetypes* (a too-clever way of saying "project templates"). ... {info} h2. Running the New Application in Jetty h1. Running the New Application using Jetty One of the first things you can do is use Maven to run Jetty directly. ... This is a complete little application; it doesn't do much, but it demonstrate how to create a number of pages sharing a common layout, and demonstrates some simple navigation. h2. Loading the Project into Eclipse You should hit Control-C in the Terminal window to close down Jetty. Let's look at what Maven has generated for us. To do this, we're going to load the project inside Eclipse and continue from there. Start by hitting Control-C in the Terminal window to close down Jetty. Next, we'll ask Maven to create our Eclipse project for us: {noformat} $ mvn eclipse:eclipse -DdownloadSources=true [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'eclipse'. [INFO] org.apache.maven.plugins: checking for updates from apache-snapshots [INFO] org.codehaus.mojo: checking for updates from apache-snapshots [INFO] artifact org.apache.maven.plugins:maven-eclipse-plugin: checking for updates from apache-snapshots [INFO] snapshot org.apache.maven.plugins:maven-eclipse-plugin:2.9-SNAPSHOT: checking for updates from apache-snapshots Downloading: http://repository.apache.org/snapshots//org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT/maven-eclipse-plugin-2.9-20101117.070458-148.pom 11K downloaded (maven-eclipse-plugin-2.9-20101117.070458-148.pom) Downloading: http://repository.apache.org/snapshots//org/apache/maven/plugins/maven-eclipse-plugin/2.9-SNAPSHOT/maven-eclipse-plugin-2.9-20101117.070458-148.jar 194K downloaded (maven-eclipse-plugin-2.9-20101117.070458-148.jar) [INFO] [INFO] Building tutorial1 Tapestry 5 Application [INFO]task-segment: [eclipse:eclipse] [INFO] [INFO] Preparing eclipse:eclipse [INFO] No goals needed for project - skipping [INFO] [eclipse:eclipse {execution: default-cli}] [INFO] Using Eclipse Workspace: /Users/Howard/Documents/workspace [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER [INFO] Wrote settings to /Users/Howard/Documents/workspace/tutorial1/.settings/org.eclipse.jdt.core.prefs [INFO] Wrote Eclipse project for "tutorial1" to /Users/Howard/Documents/workspace/tutorial1. [INFO] [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 5 seconds [INFO] Finished at: Wed Nov 17 17:13:11 PST 2010 [INFO] Final Memory: 21M/81M [INFO] ~/Documents/workspace/tutorial1 $ {noformat} At this point, Maven has created the Eclipse {{.project}} and {{.classpath}} files, and we can import the project. Launch Eclipse and switch over to the Java Perspective. Right click inside the Package Explorer view and select *Import ...* !eclipse-java-persp.png|align=center,thumbnail! Choose the "existing projects" option: !eclipse-import.png|align=center,thumbnail! Now select the folder created by Maven: !eclipse-import-folder.png|align=center,thumbnail! When you click the Finish button, the project will be imported into the Eclipse workspace. !eclipse-project-errors.png|align=center,thumbnail! However; there are many errors. Maven expects that you will configure a classpath variable, {{M2_REPO}}, that points at your local repository; a directory in your home directory that stores all those downloaded JARs and other files. Open Eclipse's preferences panel and navigate to *Java > Build Path > Classpath Variables*: !eclipse-classpath-vars.png|align=center,thumbnail! Click the *New* button, and enter the new variable (you'll have to adjust this for your operating system and local paths): !eclipse-new-var.png|align=center,thumbnail! Eclipse will ask to perform a clean build, and the errors will be gone once it has done so.
[CONF] Apache Tapestry > Creating The Skeleton Application
Creating The Skeleton Application Page edited by Howard M. Lewis Ship Changes (5) h1. Chapter 2: Your First Tapestry Application {tutorialnav} {info} This chapter may look long, but almost all of it is one-time setup for Maven and Eclipse. The actual Tapestry part is really small and simple. Enjoy! We will shortly be splitting it into two chapters. {info} ... [Continue on to chapter 3: Implementing The Hi/Lo Game|TAPESTRY:Hilo] {tutorialnav} Full Content Setting Up Your EnvironmentCreating The Skeleton ApplicationFormsForms2Hilo This chapter may look long, but almost all of it is one-time setup for Maven and Eclipse. The actual Tapestry part is really small and simple. We will shortly be splitting it into two chapters. Before we can get down to the fun, we have to create an empty application. Tapestry uses a feature of Maven to do this: archetypes (a too-clever way of saying "project templates"). What we'll do is create an empty shell application using Maven, then import the application into Eclipse to do the rest of the work. For the tutorial, we're using a fresh install of Eclipse and an empty workspace at /Users/Howard/Documents/workspace 1 . You may need to adjust a few things for other operating systems or local paths. From our workspace directory, we'll use Maven to create a skeleton Tapestry project. Before proceeding, we have to decide on four things: A Maven group id and artifact id for our project, a version, and a base package name. Maven uses the group id and artifact id to provide a unique identity for the application, and Tapestry needs to have a base package name so it knows where to look for pages and components. For this example, we'll use the group id com.example, artifact id tutorial1, version 1.0-SNAPSHOT and we'll use com.example.tutorial as the base package. Our final command line is: mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org It will then prompt you to pick the archetype - choose Tapestry 5.2.4 Quickstart Project, enter the group id, artifact id, version and package when prompted. ~/Documents/workspace $ mvn archetype:generate -DarchetypeCatalog=http://tapestry.apache.org [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] [INFO] Building Maven Default Project [INFO]task-segment: [archetype:generate] (aggregator-style) [INFO] [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: http://tapestry.apache.org -> quickstart (Tapestry 5.2.4 Quickstart Project) 2: http://tapestry.apache.org -> tapestry-archetype (Tapestry 4.1.6 Archetype) Choose a number: : 1 Choose version: 1: 5.1.0.5 2: 5.0.19 3: 5.2.4 Choose a number: 3: 3 Define value for property 'groupId': : com.example Define value for property 'artifactId': : tutorial1 Define value for property 'version': 1.0-SNAPSHOT: Define value for property 'package': com.example: com.example.tutorial Confirm properties configuration: groupId: com.example artifactId: tutorial1 version: 1.0-SNAPSHOT package: com.example.tutorial Y: [INFO] [INFO] BUILD SUCCESSFUL [INFO] [INFO] Total time: 1 minute 41 seconds [INFO] Finished at: Wed Nov 17 17:00:16 PST 2010 [INFO] Final Memory: 16M/81M [INFO] ~/Documents/workspace $ The first time you use Maven, you'll see quite a bit more output, mostly about downloading all sorts of JARs and other files. These downloaded files are cached locally and will not need to be downloaded again, but you do have to be patient on first use. After executing the command, you'll see a new directory, tutorial1. Maven Behind a FirewallIf you are behind a firewall, before running any "mvn" commands, you will need to configure your proxy settings in settings.xml. Here is an example: settings.xml true http myProxyServer.com 8080 joeuser myPassword C:/Documents and Settings/joeuser/.m2/repository Of course, adjust the localRepository element to match the correct path for your computer. Running the New Applic