Deploying the application

The installation guide provides a description on how to set up the application in the web container using the emptyproject. For clarification, here are some descriptions of the required jars/zip in the distribution

      	
+--jars
	commons-fileupload-${version}.jar		# dependency jar from apache
	commons-invoke-${version}.jar			# dependency jar from onemind
	commons-java-${version}.jar			# dependency jar from onemind
	jxp-${version}.jar				# template language from onemind
	servletapi-${version}.jar			# dependency from sun
	swingweb-${version}.jar				# this jar contains the swingweb implementation and servlet
	swingweb-template-${version}.jar		# this jar has the jxp template for most awt/swing components
+--swingweb-toolkit                        					
	swingweb-${version}-toolkit.jar			# These two files is the awt toolkit implementation and must be
	awtbrige-${version}.jar				# added to the CLASSPATH of the jvm
+--web
	swingweb-template-common-${version}-web.zip	# this contains the css/javascript, must be extract to base dir of web context
The deployment requires that all the things in swingweb-toolkit directory above is set to CLASSPATH, all the files in jars goes to WEB-INF/lib (or common shared path if sharing is desired), and swingweb-template-common-${version}-web.zip to be unzip in the web context root. In addition to these, here are the configuration part of swingweb:
  1. WEB-INF/web.xml Here is an example:
    <webapp>
    	...
    	<listener>
    		<listener-class>org.onemind.swingweb.servlet.SwingWebContextDestroyer</listener-class>
    	</listener>
    	<servlet>
    		<servlet-name>myapp</servlet-name>
    	  	<servlet-class>org.onemind.swingweb.servlet.SwingWebServlet</servlet-class>
          	<init-param>
            	<param-name>app-class</param-name>
            	<param-value>MyAppClass</param-value>
          	</init-param>      
          	<init-param>
            	<param-name>swingweb-config</param-name>
            	<param-value>/swingweb-common-config.xml</param-value>
          	</init-param>      
      	</servlet>
        <servlet-mapping>
        	<servlet-name>myapp</servlet-name>
        	<url-pattern>/app1</url-pattern>
      	</servlet-mapping>
    	...
    <webapp>
    			
    The SwingWebContextDestroyer is needed to clean up the web context when it is destroy. The servlet has two init parameters, the app-class and swingweb-config. SwingWeb config must be a file that exists in your classpath. The most convenient location to place the swingweb config file is in WEB-INF/classes
  2. WEB-INF/classes/swingweb-common-config.xml

    Most part of the configuration in swingweb-common-config.xml should not be modified except the template source. You can refer to the configuration guide in section 2.3 on the template source configuration.