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 .
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.
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
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.
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:
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:
Now change the content according to your wish :)
Building the Project
You can build the project using F11 and run by F6.