7.2 XMA Webapplication

A XMA-Webapplication is conforms to the WAR-Standard (see: http://java.sun.com/j2ee/1.3/docs/ servlet specification (2.3) -> Chapter 9 : Web Applications ), with a view additional specifications:

  1. Contains theApplication and Plugin Descriptors (Application and Plugin Descriptors)

  2. Component-Archives are packed to be downloaded by the client-runtime

  3. The web.xml File contains all required XMA-Configurations

  4. The Server Runtime is included into the WEB-INF/lib

  5. All Help-pages are included in help/at/spardat

Example:

webapplication structure

Figure 7.7. webapplication structure


A web.xml of an XMA application has to register these servlets and listener:

Beside registering and mapping the servlets, the *.xma URL pattern ist mapped to the MIME type application/x-xmalauncher.

The following listing shows a suitable web.xml. Note that the XMA project creation wizard for Eclipse always generates a web.xml such as this (also see Overview).

<web-app>
   <filter>
       <filter-name>HashFilter</filter-name>
       <filter-class>at.spardat.xma.session.HashFilter</filter-class>
   </filter>

    <filter-mapping>
       <filter-name>HashFilter</filter-name>
       <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>at.spardat.xma.boot.server.BRTContextListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>session</servlet-name>
        <servlet-class>at.spardat.xma.session.LoginServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>rpc</servlet-name>
        <servlet-class>at.spardat.xma.rpc.RPCServletServer</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>tabular</servlet-name>
        <servlet-class>at.spardat.xma.datasource.TabularServletServer</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>launch</servlet-name>
        <servlet-class>at.spardat.xma.boot.servlet.XmaLauncherServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>session</servlet-name>
        <url-pattern>/session</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>rpc</servlet-name>
        <url-pattern>/rpc</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>tabular</servlet-name>
        <url-pattern>/tabular</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>launch</servlet-name>
        <url-pattern>*.xma</url-pattern>
    </servlet-mapping>

    <mime-mapping>
       <extension>xma</extension>
       <mime-type>application/x-xmalauncher</mime-type>
  </mime-mapping>

    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>
</web-app>