|
| By Ajay Acharya, Mukesh Garg, and Marina Sum, January 23, 2007; updated: June 18, 2007 and January 7, 2008 |
|
| |
You can develop, deploy, and debug Web applications that are based on the Java 2 Platform, Enterprise Edition 5 (Java EE 5 platform) with NetBeans 6.0, an integrated development environment (IDE). A plug-in for Sun Java System Web Server 7.0 (henceforth, Web Server 7.0) is available as open source in NetBeans 6.0.
Note: The Web Server 7.0 plug-in for NetBeans 5.0 supports the J2EE 1.4 platform only, not the Java EE 5 platform.
This article describes how to install and use that plug-in in NetBeans 6.0 to develop and deploy Web applications to Web Server 7.0.
Note: The topic of Web application projects in NetBeans is outside the scope of this article. For details, see NetBeans online help.
| |
To install the Web Server 7.0 plug-in, first install the Java 2 Platform Standard Edition Development Kit and then the NetBeans 6.0 IDE.
Tip: To ensure access to the NetBeans IDE, Web Server 7.0 must be owned and installed by the same user who runs the NetBeans IDE.
Afterwards, do the following:
You have now installed the Web Server 7.0 plug-in in the NetBeans IDE.
| |
Note: Though several screen shots in the rest of this article show NetBeans 5.0, they also apply to NetBeans 6.0.
Next, register Web Server 7.0 in NetBeans 6.0. Follow these steps:
Figure 1: Choose Server Pane in Add Server Instance Wizard
|
Figure 2: Server Location and Configuration Pane in Add Server Instance Wizard
|
If your Web Server 7.0 instance contains multiple configurations, when you first open its node in NetBeans 6.0, a dialog box with a drop-down list of the configurations that contain at least and at most one virtual server and one associated instance is displayed. See Figure 3. You must select one of those configurations for deployment from the IDE. This is a one-time selection only.
Figure 3: Selection of Configuration for Deployment
|
| |
After registration, the Sun Java System Web Server 7.0 node is displayed under Servers in the Runtime tab of the IDE. To start the Administration Server, right-click the Sun Java System Web Server 7.0 node and choose Start from the context menu. See Figure 4.
Note: You cannot start the Administration Server if the server was registered as a remote server.
Figure 4: Start Menu Item for Administration Server of Web Server 7.0
|
You can expand the nodes to view all the Web applications, resources, and so forth in a configuration. Figure 5 is an example.
Figure 5: Components in a Web Server Configuration
|
| |
To create a Web application for Web Server 7.0, follow these steps:
Figure 6: Name and Location Pane in New Web Application Wizard
|
Figure 7: New Web Application Project
|
You can see that all the basic files are in place, including the Web Server 7.0-specific deployment descriptor, the
sun-web.xml file. To edit that file, double-click its name to open a GUI editor on the right. Alternatively, right-click its name and choose Edit from the context menu.
The Web application project is now ready: You can edit, compile, and deploy it to Web Server 7.0. You can also run or debug the application from the IDE.
| |
You can debug Web applications by right-clicking the Web project in the IDE and choosing Debug from the context menu. Web Server will then start in debug mode and the IDE will stop executing the program at the breakpoint you have set in your application.
For details on debugging Web applications in NetBeans 6.0, see the IDE's online help.
| |
Following are the Web Server 7.0 operations you can perform in NetBeans 6.0 with the plug-in installed:
server.xml file of the server instance.
1
1 This capability is not available for the remote server.
| |
