One of the goals of NetBeans IDE is to keep you from having to deal with deployment descriptors as much as possible. This is achieved via the zero-configuration concept implemented in the IDE. When you use the provided commandssuch as Call Enterprise Bean, Use Database, Call Message, Send Email from your application, or Call Web Service Operationthe IDE performs the following tasks:
Of course, you are still allowed to edit the deployment descriptors. Here also, NetBeans IDE offers significant ease-of-use features, such as two editing modes (direct XML editing with code completion and online validation features, and visual editing). The visual editor for a deployment descriptor file (shown in Figure 11-13) is opened by double-clicking the deployment descriptor's node in the Projects window. A set of views is available. For an EJB module, for example, General and XML views are available. Also, a combo box to the right of the buttons for the views allows you to jump directly to a particular section in the deployment descriptor file. Figure 11-13. Visual deployment descriptor editorIf you want to edit the file's XML code directly, you can switch to the XML view of the file by clicking the XML toggle button located at the top of the visual editor. When you open an XML file in the Source Editor (shown in Figure 11-14), you are able to use code completion, which makes hand coding faster and more accurate. See Generating Code Snippets without Leaving the Keyboard in Chapter 5 for a general discussion of how code completion works. Figure 11-14. XML deployment descriptor editor with code completionAlso note the toolbar at the top of the Source Editor. The last icon activates the XML validation action so that you can verify the conformance of the deployment descriptor file with the DTD or schema. See Figure 11-15 for an example of the output after running the XML Validation command. Figure 11-15. Output of XML validation |