Sun has released an installation bundle that contains Sun Java System Application Server PE 8 (Application Server PE 8) and NetBeans 3.6. The bundle also contains a NetBeans module that helps form an integrated environment for developing web applications for deployment to Application Server PE 8. This paper highlights the capabilities of that module by giving you a quick, hands-on tour and then describing the module elements in more detail.
This paper contains the following major sections: Tour of the Integration Module
This tour contains the following steps that describe many of the module's capabilities:
Creating a Web Module in NetBeans
This step introduces the concept of the web module. Web modules are special file systems that are recognized by NetBeans because of their content. NetBeans contains menu items from which you can create one of those file systems. See FIGURE 1.
To create a web module, follow these steps:
Creating a JSP Page in the Web Module
This step introduces the JavaServer Pages (JSP) template and the Template Wizard. The latter creates files by completing templates with the values that you enter. The JSP page you create in this step displays information on the web container that executes the JSP page, which verifies the Default Server property value of the Server Registry node. To create a JSP page in the web module, do the following:
Executing the JSP Page
This step demonstrates how the NetBeans environment automates the control of the web container state and deployment. To execute the JSP page, do the following:
After these two phases are complete, the dialog box closes automatically. Next, the configured web browser opens and accesses the URL for the JSP page. The page that appears in the browser contains the following text: Sun-Java-System/Application-Server-PE-8.0 For example, if you configured the default server instance to be the Tomcat server, the displayed page reads: Apache Tomcat/5.0.19 Disabling a Web Module Deployed to an Application Server 8 Instance
This step describes the server configuration capabilities of the Runtime Explorer. The module that contains the JSP page executed in the preceding step is deployed to the Application Server PE 8 instance. To disable that module from the Runtime Explorer, do the following:
Capabilities of the Integration Module
The preceding tour briefly introduced the integration module, which integrates Application Server PE 8 into the workflow of developing web applications in NetBeans. The module provides NetBeans the following capabilities:
You can configure a web application from the floating menu of the The following subsections describe these elements of the module. Configurations of Elements
The web container for Application Server PE 8 contains many configurable elements. You can revise most of them by editing the
Deployment of Web Applications The module extends NetBeans to deploy web applications to instances of Application Server PE 8. These instances can run locally on the same computer or remotely on a networked computer. Deployment starts upon execution or debugging of a web application, one of the JSP pages, or servlets associated with the application. Deployment is optimized when execution occurs on a local instance. The code of the application is deployed in place. This mode eliminates many of the steps required for archive deployment. New Runtime Explorer Nodes The module adds many nodes to the Runtime Explorer. See FIGURE 11.
The most important node is the Sun Java System Application Server 8 node, which represents the integration module. This node is visible as a child of the Server Registry node. You can configure its properties to your environment. FIGURE 12 shows an example of the Properties window.
The most important property is Installation Root Directory, which directs the module to access classes from the installed Application Server PE 8 Each registered instance of Application Server PE 8 appears under the integration module node. The setup of the node hierarchy is the same as that in the Administration Console.
The menu items and property editors for the nodes in the hierarchy perform many of the tasks that are available in the Administration Console or the In addition, the module does the following:
Additional Server Instances You can register multiple server instances from the Register Server Instance dialog box (see FIGURE 13). They appear as additional nodes in the Runtime Explorer.
You can select one of these nodes as the default instance for deployment and execution. For more information, see the next section. Because remote instances execute on a networked computer, you cannot start the server or view the logs for those instances: Those tasks require access to the instances' installation directories. Default Server Instance Many tasks that are associated with web applications use the default server as an implicit argument--for example, the Execute item on a web application node's floating menu. The web application executes in the default instance's web container. To execute a web application on a server instance, you designate that instance as the default server by choosing Set As Default from an instance node's floating menu. The bundle installation process registers an Application Server PE 8 server instance as the default instance. However, if you install the module from the NetBeans Update Center, you must register an Application Server PE 8 instance and configure it as the default. Templates The module extends the File Creation wizard with additional templates. See FIGURE 14.
From these templates, you can define resources for Application Server PE 8. Because the definitions are saved to the file system, you can register them to multiple servers. If a resource depends on another resource, you can create multiple definitions in a single invocation from a template. See FIGURE 15.
After the wizard is complete, NetBeans creates an XML file that defines the resource. You can use this file to register the resource on multiple server instances. Although the file content is hidden, you can edit the resource definitions from the Properties Editor. See FIGURE 16.
An additional menu item for resource definition file nodes is Register, which pushes a definition to a server instance. When registration is complete, NetBeans shows the resource as a child of the instance in the Runtime Explorer. See FIGURE 17 for an example.
You can edit the resource instance from its Properties Editor. FIGURE 18 shows an example of the properties of a registered resource.
References
About the Author
Vince Kraemer, currently a staff engineer at Sun, joined the company in 1997. He has been working with Sun products for more than 18 years and developing tools for programmers for more than 12 years. The integration module for NetBeans is the latest of a string of projects that are slated to ease the process of developing and deploying J2EE applications. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||