Developing with Eclipse

 

MI Directory Structure

This chapter briefly describes the directory structures of the MI client and of mobile JSP applications. Accent will be made on MI Client for Browser UI (JSP), but the file structure is almost identical for the MI Client for Java UI (AWT).

Directory Structure of MI framework

In order to support Java Server Page (JSP) technology for developing applications for the MI, MI client integrates Jakarta Tomcat 3.2.4 server. Tomcat is a servlet container used in the official reference implementation for the Java Servlet and Java Server Pages technologies. The Java Servlet and Java Server pages specifications are developed by Sun under the Java Community Process.

The following screenshot shows the directory structure of MI 2.1:

The following table describes the individual directories and their role.

Folder name

Description
bin Contains startup/shutdown scripts
conf Contains various configuration files including the server.xml (Tomcat's main configuration file) and web.xml (sets the default values for the various web applications deployed in Tomcat).
lib Contains various jar files that are used by Tomcat. Any file in this directory is appended to Tomcat's classpath (this applies to the desktop version of MI only, not to the WindowsCE/PocketPC version of MI
log Contains Mobile Infrastructure log/trace files. The trace file trace.txt is stored here, if trace is activated.
logs Contains Tomcat its log files.
settings This directory hosts the MI Registry, user-individual and global configuration files as well as all conversation IDs.
sync The sync folder contains data flagged for synchronization.
webapps Contains all deployed web applications (for example, TESTAPP_JSP), including the UI part of MI itself.
work This folder is automatically generated by Tomcat. It is where Tomcat places intermediate files (such as compiled JSP files) during its work. You will not be able to execute JSP pages if you delete this directory while Tomcat is running.

 

Directory Structure for Web Applications

The following screenshot shows the directory structure relevant for web applications:

A web application is a structured hierarchy of directories. The root of this hierarchy is used as a document root that serves the files that are part of this context. The folder webapps is the home directory of MI's (and therefore Tomcat's) web server. This is the main folder for the "public" section. All files and subfolders in this folder are visible to the "world". The MI framework and microITS applications will be stored in the me folder and its subfolders.

A special directory exists within this application hierarchy called WEB-INF. The WEB-INF folder is the main folder of the "private" section of a Web application. All files and subfolders in this folder are invisible to the "world". This is why for example the /mimes folder (which typically contains images used in JSP) is located in the "public" section.

Each application needs its own web.xml file in the WEB-INF directory. This XML file is the deployment descriptor for servlets and other components that make up the application, along with any initialization parameters and container-managed security constraints that you want the server to enforce for you.