• No results found

Deployment descriptors

In document Web Application Developer s Guide (Page 36-38)

Each WebApp must have a WEB-INF directory. This directory contains information needed by the web server when the application is deployed. This information is in the form of deployment descriptor files. These files have .xml extensions. They are shown in the Deployment Descriptors node in the project pane. The WEB-INF directory is actually a subdirectory of your WebApp’s root directory. It isn’t shown under the Root Directory node of the project pane because it is a protected directory that cannot be served by the web server. You can change this with the Directories page of the WebApp Properties dialog box.

The WebApp’s Deployment Descriptors node always contains a deployment descriptor file called web.xml. This is required by all Java- enabled web servers and is created by JBuilder when you create the WebApp. If you are using the Struts framework in your WebApp, the struts-config.xml file will also be located in the Deployment Descriptors node.

Your web server may also require additional deployment descriptors which are unique to that particular web server. These can be edited in JBuilder and are created if they are listed as required by the currently configured web server plug-in. Check your web server’s documentation to find out which deployment descriptors it requires.

JBuilder provides a deployment descriptor editor for editing the web.xml file. You can also edit server-specific deployment descriptors in JBuilder. Some mappings in the web.xml file are required for the WebApp to work as desired within the JBuilder IDE. These mappings will be written for you when you use JBuilder’s wizards to create the pieces of your web application. Other mappings may be required when you deploy your application. For more information on deployment descriptors and the WebApp DD Editor, see “Editing deployment descriptors” on page 11-4.”

W o r k i n g w i t h W e b A p p s a n d W A R f i l e s 3-7

T h e W e b A p p a n d i t s p r o p e r t i e s

WebApp properties

The WebApp node in the project pane has various properties you can edit. To edit the WebApp node’s properties, right-click the node and select Properties from the menu. The WebApp Properties dialog box has five pages: • WebApp • Directories • Classes • Dependencies • Manifest

The WebApp page

The WebApp page of the WebApp Properties dialog box indicates the name of the WebApp, the directory location of the WebApp, and the directory location of the WAR file. There is a drop-down list indicating when to generate (or update) the WAR file, and a checkbox indicating whether or not to compress the archive. The setting for creating the archive corresponds to the “Build WAR” drop-down list in the Web Application wizard. You may wish to turn WAR generation off during development, and only enable it before you build the project for the final time prior to deployment.

The bottom of the WebApp page is divided into two tabbed pages: JSP/ Servlet Frameworks and File Types Included.

The JSP/Servlet Frameworks page allows you to select JSP/Servlet Frameworks to be used in the WebApp. The page automatically contains four frameworks that ship with JBuilder; Cocoon, InternetBeans Express, JSTL (JavaServer Pages Standard Tag Library), and Struts. If you use the Configure Libraries dialog box to add user-defined frameworks, these frameworks will also be available in this list.

The File Types Included page contains a list of file types to include for both file browsing and WAR generation. Only the file types which are checked will be included, based on file extension. The file extensions associated with each file type can be viewed or changed in the IDE Options dialog box, available from the Tools menu.

The Launch URI drop-down list is used to specify a URI to launch when running the WebApp. If a WebApp has a specified Launch URI, you can Web Run/Debug/Optimize directly from the context menu of the WebApp node in the project pane. Some frameworks, like Cocoon, have a preferred Launch URI, which is set automatically when the framework is chosen. This preferred Launch URI can be overridden. If the desired URI

T h e W e b A p p a n d i t s p r o p e r t i e s

is not shown in the drop-down list, click the ellipsis (...) button to browse to it.

Figure 3.3 WebApp page of WebApp Properties dialog box

See also

• “Creating a WebApp with the Web Application wizard” on page 3-3

• “Presenting XML documents” in the XML Developer’s Guide • Chapter 7, “Using InternetBeans Express”

• Chapter 8, “Using the Struts framework in JBuilder”

• “Using the Configure Libraries dialog box to manage user- defined frameworks” on page 6-6

In document Web Application Developer s Guide (Page 36-38)