The File menu allows you to import and export Workbench resources. Also you can use context menu.
The File > Import ... option launches the import wizard, which allows you to add resources to the Workbench.
The File > Export ... option launches the export wizard, which allows you to export resources from the Workbench.
This wizard helps you import resources into the Workbench. When the Import Wizard first comes up, you must choose what type of import to do:
Imports a project into this workspace that was previously located in this workspace, or that currently exists in another workspace.
If you choose this option, you will import files from the file system.
If you choose this option, you will import files from an archive (*.zip, *.jar) file.
Importing Web archive (WAR) file
A Web archive (WAR) file is a portable, packaged Web application. In some cases, you may wish to work with existing workbench Web projects that exist in other locations. It may be advisable to determine whether the WAR file that you are importing contains Java source files if you have a use for them.
Note: When importing a WAR file into an existing Web project, the imported Web deployment descriptor files are either not changed or overwritten by the ones included the imported WAR file, based on your response to the prompt that is provided. In either case, this action does not represent a merging of the two sets of deployment descriptors.
To work with these Web project resources, you can import them into your own development environment, as follows:
Create the project that you wish to import Web resources into using the Create a Web Project wizard.
Select File > Import.
In the Import dialog, either double click on WAR file or select WAR file and click Next.
Locate the WAR file that you want to import using the Browse button.
Specify a new or existing Web project that you want to import the WAR into. If it is a new project, you will need to supply a name and location for the project.
Specify a context root for the Web project if it differs from the default. The context root is the Web application root, the top-level directory of your application when it is deployed to a Web server. You can change the context root after you create a project using the project Properties dialog, which you access from the project's context menu. The context root can also be used by the links builder to ensure that your links remain ready to publish as you move and rename files inside your project.
Specify the name of a new or existing Enterprise Application (EAR) project that the new Web project should be imported into for purposes of deployment. Any folders and files in the specified New project location, as well as associated subfolders and contents, will be included in the project. If you select the Existing radio button, the you can accept the default, or use the Browse button to locate another existing Enterprise Application project. If you select the New radio button, you can either accept the default Enterprise Application project location, or use the Browse button to define another location.
Note: If you want to add a Web project as a module to another Enterprise Application project in the future, you can open the application.xml editor for the Enterprise Application project and select the Add option in the General page.
Optionally, supply WAR import Options, such as whether to overwrite any existing project resources during the import process.
Click Finish to populate the Web project.
This wizard help you export resources from the Workbench.
When the Export Wizard first comes up, you must choose what type of export to do:
If you choose this option, you will export files to the file system.
If you choose this option, you will export files to an JAR file.
You can make JAR file executable (java -jar XXXXXXX.jar).
If you choose this option, you will export files to an archive (zip) file.
Exporting Web Archive (WAR) file
A Web archive (WAR) file is a packaged Web application that can be exported to test, publish, and deploy the resources developed within a Web project.
To export WAR file from a Web project, do the following:
From the context menu of a Web project folder, select Export .... You can alternatively select File -> Export, then WAR File, and click Next.
Specify the Web project you wish to export (this field is primed if you used the context menu to launch the wizard), and specify a location for the new WAR file.
Optionally, supply WAR export Options, such as whether or not to include Java source files in the WAR, and whether to overwrite any existing resources during the export process.
Note: Source files are not usually included in a WAR file, because they are not necessary for the server to run the web application.