UsingTapestryFramework

Using the Tapestry Framework With NetBeans

In this tutorial we will learn how to use the Tapestry Framework with NetBeans.

The Tapestry Framework

     Tapestry is an open-source framework for creating dynamic, robust, highly scalable web applications in Java. Tapestry complements and builds upon the standard Java Servlet API, and so it works in any servlet container or application server.
     Tapestry divides a web application into a set of pages, each constructed from components. This provides a consistent structure, allowing the Tapestry framework to assume responsibility for key concerns such as URL construction and dispatch, persistent state storage on the client or on the server, user input validation, localization/internationalization, and exception reporting. Developing Tapestry applications involves creating HTML templates using plain HTML, and combining the templates with small amounts of Java code using (optional) XML descriptor files. In Tapestry, you create your application in terms of objects, and the methods and properties of those objects -- and specifically not in terms of URLs and query parameters. Tapestry brings true object oriented development to Java web applications.
             Tapestry is specifically designed to make creating new components very easy, as this is a routine approach when building applications. Tapestry is architected to scale from tiny applications all the way up to massive applications consisting of hundreds of individual pages, developed by large, diverse teams. Tapestry easily integrates with any kind of back-end, including J2EE, HiveMind  and Spring .


Preface

This has been tested with NetBeans 5.5.1and Apache Tomcat 5.5.17 using JDK 1.5 on Windows and Linux. NetBeans is supposed to be installed using the bundled Tomcat 5.5.17 container or higher.


Softwares Required:

1.Modules to support Tapestry on NetBeans

2. NetBeans IDE 5.5.1 with bundled Tomcat (as the Tapestry Supprt Module for NetBeans IDE currently does not support NetBeans 6.0)

3. Java Standard Development Kit (JDK™) version 1.5


Getting Started with Tapestry Framework on NetBeans

First of all we will install all the software needed and ensure that the project is set up correctly.

1. Goto Tools -> Update Center and choose "Install manually downloaded modules" so that we can give install the modules previously downloaded. File:Update Center

File:Installing manually downloaded modules Click Next.

2. Click on the Add button to browse all the three modules one by one. File:Adding module files

3. At the next step you are asked to view certificates and finalize install. Include all the three modules by checking the radio button to their left. File:004_UsingTapestryFramework.jpg

4. Choose File > New Project. Under Categories, select Web. Under Projects, select Web Application. Click Next. File:005_UsingTapestryFramework.jpg

5. In the Name panel, type Demo and change the Project Location to any directory on your computer. File:006_UsingTapestryFramework.jpg

6. Here you have to choose from the available frameworks, choose " Typestry 4.0". At the bottom you can see a message asking you to create a library and add some jar files to it. Do remember the name of the library asked to be created as we will be using it at a later stage. Click the "Download Bundle" link, shown in the screenshot above, the Tapestry Support Module for NetBeans IDE page will open in the IDE's default browser. From there, you can download all the JARs in one go. File:007_UsingTapestryFramework.JPG

7. Now finish the wizard and create the required library by going at Tools -> Library Manager.

Error creating thumbnail: Image type not supported

8. Click "New Library" at the bottom left of the wizard and enter Library Name same as that asked in step 6. Once the Library is created add those jar files to it which we downloaded at step 6. File:009_UsingTapestryFramework.JPG

9. Repeat step 4 and you will see that now the IDE is compatible with Tapestry Framework. Leave values as default and click Finish. File:010_UsingTapestryFramework.JPG

10. The IDE creates the Demo project. The project contains all of your sources and project metadata. You can view its logical structure in the Projects window (Ctrl-1). Make sure that all the JAR files are available, when you expand the Libraries node. If they are not there, manually add them by right-clicking the Libraries node, choosing Add JAR/Folder, and browsing to the JARs in your filesystem. Before going further, your Libraries node should contain the following JAR files: File:011_UsingTapestryFramework.JPG File:012_UsingTapestryFramework.JPG

11. Without any programming whatsoever, you can already run your application. Right-click the project node and choose Run Project. The server starts, if it is not running already, and the application is deployed. The IDE's default browser starts up, showing you the following overview page: File:013_UsingTapestryFramework.JPG File:014_UsingTapestryFramework.JPG

Now change the content according to your wish :)

Building the Project

You can build the project using F11 and run by F6.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo