MDK Development Cycle | MDK Wizard Configuration | Export a Project into a .war File
To activate this function select following commands from the Eclipse menu: File > Import > MDK: Import a web archive (.war) into a new project
The "import .war file" function creates a new project in Eclipse based on an existing .war file. The .war file is extracted and the files of the .war file are placed in appropriate folder of the new Eclipse project. If the .war file contains the source code of the application (WEB-INF/srclib/application_name.src.zip) the source files are placed in packages in the Eclipse project. This allows you to alter the source code of the project and create a new .war file (see, Export a Project into a .war File). All .war files supplied by the Mobile Application Development Kit (MDK) contain the source code.
Dialog window:
The dialog windows has three input fields:
When all entries are correct the 'Finish' button is enabled. To start the import function press the 'Finish' button.
The project is generated in the Eclipse workspace and the classpath of the project is set properly. The classpath definition is made as follows:
If your application needs additional .jar files, you should place them in the WEB-INF/lib folder and use the MDK project properties function to update the classpath or use the the exlib folder function of the Mobile Infrastructure (see the Mobile Infrastructure Installation Guide for details).
![]() |
The Mobile Infrastructure class loader however traces all Mobile Infrastructure applications to find the class to load, regardless of the Mobile Infrastructure application name. Therefor it is important to deploy applications that have unique class names (package + class name). We recommend to change at least the package names of a newly imported project, when you plan to deploy the project as new Mobile Infrastructure application. |
Usually the .war file has following folders:
META-INF
Contains the MANIFEST.MF fileWEB-INF
This defines the "private" (= files not seen by the world) section of your web application. The WEB-INF folder contains, besides the web.xml file, the/lib
folder for the .jar files and the/classes
folder for the class files of your application. In .war files provided with the MDK and in .war files you generated with the "MDK: Export a project" function (and enabled the option to include the source code) you will find also a/srclib
folder which contains a .jar file with the packed source files of the application.
Depending on the application you will find other folders in the "root" and the "WEB-INF" folder.
After a .war file has been imported in a new project you will find following Eclipse project folder structure:
java
A package folder that will contain the source code of the application. The source code is extracted from the .war file folderWEB-INF/srclib/application_name.src.zip.
app-root
A folder that contains the "root" folder of the .war file. In the "app-root" folder you will find the folders "META-INF", "WEB-INF" etc..
Resource Bundles can be stored in the WEB-INF/classes
folder or
can be packaged in the .jar file in WEB-INF/lib
folder. After you
imported the .war file all .properties file will be placed in the Eclipse project
source folder java
.
When you export your mobile application to a .war file you have the option
if the .properties files should be stored in the WEB-INF/classes
folder
or be packed in the .jar file in the WEB-INF/lib
folder.