Classes page, WebApp properties dialog box

This is a feature of JBuilder Enterprise.

The Classes page of the WebApp properties dialog box is where you choose what classes and class resources are included in the WAR file. In this step, you can also choose additional classes or files.

Include Required Classes And Known Resources

This option copies any classes that you have specifically added to your WebApp with the Add Classes button. It also adds any classes that are used by one or more of the added classes. Remember that the classes are copied to WEB-INF/classes or its subdirectories. The classes you select should therefore be classes that are accessed on the server side, not classes that need to be served by the web server. For example, servlet classes should be selected, but not applet classes.

This option also adds known resources. Known resources are those that you specifically add to the archive with the Add Files button. You can only choose class resource files under the project's source path. They will be copied to their corresponding location in WEB-INF/classes. For example, /myproject/src/com/whatever/foo.properties is copied to /WEB-INF/classes/com/whatever/foo.properties.

If you select this option and do not add any classes or files to the list, no classes or resources are copied.

Include Required Classes And All Resources

This option copies any classes that you have specifically added to your WebApp with the Add Classes button. It also adds any classes that are used by one or more of the added classes. Remember that the classes are copied to WEB-INF/classes or its subdirectories. The classes you select should therefore be classes that are accessed on the server side, not classes that need to be served by the web server. For example, servlet classes should be selected, but not applet classes.

This option also adds all class resources in the project's source path. Note that class resources are distinct from web content files. To be considered a class resource, a file must be in the project's source path and its extension must be set to Copy on the Resource tab of the Build page in Project Properties.

Web content files should not be in the project's source path. Web content should be placed in the WebApp's root directory or one of its subdirectories. It is copied to the corresponding location in the WAR file when the WAR file is built. File types which are considered web content are selected on the WebApp page of the WebApp Properties dialog box.

Always Include All Classes And Resources

This option gathers all classes on your project's outpath. The outpath is defined on the Paths page of the Project Properties dialog box. Usually, this is set to the classes directory of your project.

It also gathers all resources on the project's source path, also set on the Paths page of the Properties dialog box. Usually, this is set to the src directory of your project. Resources are files other than class files, such as images, video clips, sound files, etc.

This option is on by default. This option is the safest, as it gathers:


Caution: If you select this option, every class file in your output path is included in the WAR file. This may mean that class files and resources will be included which are not necessary. Be aware that generating a WAR with this option could take some time and become very large.

Add Classes

The Add Classes button displays a dialog box, where you select a class or classes to add to your archive. The class does not have to be in your project's outpath. If you choose either the Include Required Classes And Known Resources or the Include Required Classes And All Resources options, the Archive Builder scans these added class files for additional class dependencies and puts those classes in the archive.

Add Files

The Add Files button displays a dialog box, where you choose the file or files to add to your archive. The file must be in your project's source path. Use this option to add miscellaneous files used by the server-side classes in your web application, such as property files and database drivers.

Note: The Add Files dialog cannot look inside archive files. If a file or package you need is inside an archive file, extract it first to your source folder, then add it using the Add Files button.

Remove

Removes the selected class or file from the list.