C H A P T E R  1

Sun Java Studio Enterprise 6 Overview

This chapter provides an overview of the various parts of the Sun Java Studio Enterprise 6 development environment (hereafter referred to as the IDE) and emphasizes the use of the visual tools for developing web applications using Sun Java Studio's Web Application Framework (fomerly Suntrademark ONE Application Framework and JATO).

This document focuses on the Explorer window of the IDE. Most of the Explorer tabs provide different views of your application's file system structure, while other tabs might present other portions of the IDE's environment. Some of these tabs might be outside the scope of this document.

A completed version of the JatoTutorial application is used as a reference for demonstrating the various features of the Web Application Framework tools. If you have completed the JatoTutorial, you are familiar with the objects of this Web Application Framework application. If you have not completed the JatoTutorial, you might find it helpful to do so before proceeding with this document.

For complete documentation on the basic features of the NetBeans-based Sun Java Studio Enterprise 6 software, visit the NetBeans online documentation at: http://usersguide.netbeans.org/gwd/index.html

The following figure shows a complete view of the Sun Java Studio Enterprise 6 IDE showing the Web Application Framework Workspace.

This figure shows a complete view of the Sun Java Studio Enterprise 6 IDE. The Web Application Framework Workspace appears, along with the Component Palette.  

Any of the windows in one workspace can be included in any workspace. Default workspaces and layouts have been provided by the IDE to get you started. Therefore, you are not required to do your Web Application Framework application development in the Web Application Framework workspace.


Sun Java Studio Enterprise 6 Projects

Sun Java Studio Enterprise 6 projects provide you with an IDE sandbox, which is a way to isolate different development environments that you can customize for several different development efforts. When you run the Sun Java Studio Enterprise 6 software for the first time, you are working in the default Sun Java Studio Enterprise 6 project.

For example, suppose you have an assignment that requires working with J2ME for wireless applications. You could mount all the necessary libraries and file systems, set compiler, editor, and build options, and more, that are unique for that particular project.

In another assignment, you might be working with CORBA, RMI, and rich GUI clients. This might require the mounting of several other kinds of libraries and file systems, and it might require very different build configurations.

Another scenario might be that you are tasked with maintaining a Web application framework at the company for which you are employed. In your spare time, you might work on an open source application server effort. These two projects could be placed into separate Sun Java Studio Enterprise 6 projects: Real Job Project and Open Source Project.



Note - Before you create or open a project, make sure that all Sun Java Studio Enterprise 6 invoked processes are shutdown first to ensure a quick and clean project switchover. Go to the Runtime tab in the Explorer window, expand the Processes node, and terminate all running processes (right-click the process and select Terminate Process).



For additional information about Sun Java Studio Enterprise 6 projects, visit the NetBeans online documentation at:

http://usersguide.netbeans.org/gwd/gwd_project_setup.html#projects

Creating a New Sun Java Studio Enterprise 6 Project

To create a new Sun Java Studio Enterprise 6 project select the Project > Project Manager menu option, click New, and provide a project name when prompted. A new Sun Java Studio Enterprise 6 project is created and opens. You can configure the project as required.

Opening a Sun Java Studio Enterprise 6 Project

To open another Sun Java Studio Enterprise 6 project, select the Project > Project Manager menu option. From the list of projects, select the project that you want to open and click the Open button. If the Open button is not enabled when you select the project name, that project is the currently open project.



Caution - If you want to mount multiple Web Application Framework applications in the same Sun Java Studio Enterprise 6 project, be sure that all of those applications are using the same version of the Web Application Framework JAR (jato.jar). You might not encounter any issues at all, but there could be compilation ambiguities.




Sun Java Studio Enterprise 6 Workspaces

Toward the top of the Sun Java Studio Enterprise 6, there is a set of tabs just under the Sun Java Studio Enterprise 6 toolbars. Each of these tabs is a separate workspace. These workspaces are contained within the Sun Java Studio Enterprise 6 project (see Sun Java Studio Enterprise 6 Projects). Unlike Sun Java Studio Enterprise 6 projects, workspaces are not sandboxes, but instead all share the resources available in the current Sun Java Studio Enterprise 6 project.

The following figure shows Sun Java Studio Enterprise 6 Workspaces.

This figure shows the IDE's Workspaces. 

Sun Java Studio Enterprise 6 workspaces allow you to create customized layouts to perform specific tasks. For example, the Editing workspace contains many windows that facilitate creating and building your applications. The Debugging workspace has windows that focus on working with the built-in debugger. There is nothing unique about the different workspaces that have been provided in the Sun Java Studio Enterprise 6 by default. You can configure the Editing workspace to include all of the windows that appear in the Debugging workspace, and vice versa. The Sun Java Studio Enterprise 6 presents these default workspaces as a means of organizing certain application development tasks. You can create a new workspace of your own and name it whatever you want, and add whatever windows you want (for example, Output, Explorer, Properties, and so on).

The Web Application Framework workspace displays much like the Editing workspace. Conversely, at any time, you can customize the Web Application Framework workspace to include any of the other IDE features that are not part of its default layout. Also, you should not assume any special relationship between the Web Application Framework tab and the Web Application Framework workspace. The Web Application Framework tab can be included in any of the other workspaces.

For additional information about Sun Java Studio Enterprise 6 workspaces, visit the NetBeans online documentation at:

http://usersguide.netbeans.org/gwd/gwd_project_setup.html#workspaces


Sun Java Studio Enterprise 6 Explorer Tabs

The Sun Java Studio Enterprise 6 has a window with one or more tabs. Often, there are as many as four different tabs, as follows:

However, this can vary, as the Sun Java Studio Enterprise 6 allows for extreme layout customization. Each of these tabs exposes the Sun Java Studio Enterprise 6 environment in a different way.

For additional information about the Sun Java Studio Enterprise 6 Explorer window, visit the NetBeans online documentation at:

http://usersguide.netbeans.org/gwd/gwd_project_setup.html#explorer

Filesystems Tab

The Filesystems tab of the Explorer window displays all currently mounted directories, as shown in the following figure.

This figure shows the Filesystems tab of the Explorer window that displays all currently mounted directories. 

When you create a new Web Application Framework application, the Web Context directory (also known as servlet context or base Web application directory) is mounted automatically. Any JAR files located in the WEB-INF/lib directory of your Web Application Framework application are also mounted. Although these JAR files only physically exist in the WEB-INF/lib directory, they are displayed at the top level node.

As you add Web Application Framework components that require additional libraries (for example, jaxrpc-api.jar, and others for Web Service models) or when you manually copy JAR files to your application's WEB-INF/lib directory, the Sun Java Studio Enterprise 6 automatically mounts these new JAR files. The Sun Java Studio Enterprise 6 might not recognize a new JAR file immediately. This is dependent upon the refresh rate setting for your Sun Java Studio Enterprise 6 configuration.

Besides the virtual view of the JAR files, the Filesystems view provides the raw directory and file layout as found in your operating system's file system. As a Web Application Framework application developer, you do not need to spend much, if any, time in this view.

Project Tab

For Web applications, such as a Web Application Framework application, the Project tab displays a logical (flattened) view of your Web application's directory structure, as shown in the following figure.

This figure shows the Project tab with a logical (flattened) view of a Web application's directory structure. 

Like the JAR files in the Filesystems tab, some buried nodes are mounted at the top level node for convenient access. As a Web Application Framework application developer, you probably never need to view this tab.

Runtime Tab

The Runtime tab shows various resources available in the Sun Java Studio Enterprise 6 in the form a tree node structure.

Nodes that you might interact with while developing applications (not limited to Web applications or Web Application Framework web applications) are as follows:

The following figure shows the Runtime tab.

This figure shows the Runtime tab. 

Server Registry Node

Server Registry contains a list of all the servlet containers that can be managed and utilized from within the Sun Java Studio Enterprise 6. Tomcat and Sun ONE Application Server are two such servlet containers that come with the Sun Java Studio Enterprise 6. You might have to visit the Sun Java Studio Enterprise 6 Update Center to download and install the module if it has not already been installed by default.

Processes Node

Processes lists any processes that were launched (and are still running) by the Sun Java Studio Enterprise 6 IDE. When you compile your application, the compilation process displays in Processes until it has finished its task. When you test run your application, the servlet container process is listed here.

The servlet container remains running until you shut it down. To shut down any process launched by the Sun Java Studio Enterprise 6 IDE, go to the Processes list, right-click the desired process, and select Terminate Process.

Shut down all processes launch by the Sun Java Studio Enterprise 6 IDE before closing the Sun Java Studio Enterprise 6 IDE or switching Sun Java Studio Enterprise 6 projects. Sun Java Studio Enterprise 6 projects are managed (created, deleted, opened) from the Sun Java Studio Enterprise 6 Project menu option. Sun Java Studio Enterprise 6 projects are outside the scope of this document.

Databases Node

Databases is a list of all the RDBMS drivers and connections that have been configured in the Sun Java Studio Enterprise 6. There is a Drivers folder subnode, and potentially a list of database connections.

The Drivers folder node has a list of many vendor database driver versions. If the drivers for a particular database are available to the Sun Java Studio Enterprise 6, the Drivers folder node is enabled. Otherwise, it is disabled (a diagonal, red line through its icon). You can add new drivers by right-clicking the Drivers folder node, selecting the Add Driver action, and supplying the required driver information in the dialog box that is presented. You must also make the driver available to the Sun Java Studio Enterprise 6 by placing it in the Sun Java Studio Enterprise 6 lib/ext directory.

The connections, if any, can be connected (represented by a complete icon), or disconnected (represented by a broken icon). To connect a connection, right-click the connection node and select the Connect or Connect As action. You are prompted for the required connection information (username, password, and so on). To complete the connection, the target database server must be running, so be sure the preferred database server is started and accessible. To disconnect, right-click the connection and select the Disconnect action.

You can add new connections by right-clicking the Databases node and selecting the Add Connection action. You are prompted with the database type, location, and connection information. Before attempting to create a connection to the database, be sure, as described earlier in this section (Databases Node), that the proper driver is available to the Sun Java Studio Enterprise 6.

Web Application Framework Apps Tab

The Web Application Framework Apps tab provides a user friendly view of your Web application. You can mount one or more Web Application Framework applications in this tab. Mounting a Web Application Framework application also mounts it as a Filesystem in the Filesystems tab, and as a Web module in the Project tab. Within each mounted Web Application Framework application there are three top level nodes, as follows:

Each of these nodes is introduced in Chapter 2, Web Application Framework Apps Tab Overview, with details on creating and mounting Web Application Framework applications.