ModjyWarPackaging

Version 2 (Alan Kennedy, 03/22/2009 08:48 pm)

1 1
h1. Modjy WAR packaging
2 1
3 1
h2. Why WAR deployment.
4 1
5 1
When you deploy WSGI web applications in a java servlet container, such as "Apache Tomcat":http://tomcat.apache.org or "Glassfish":https://glassfish.dev.java.net/ , there are two different ways you can deploy
6 1
7 1
 # You deploy your application using a particular directory structure. 
8 1
 # You can deploy your application as a single file. This file is a "WAR file":http://en.wikipedia.org/wiki/WAR_file , and actually is an archive of the same directory structure described above.
9 1
10 1
So, if your application is working correctly when deployed as a directory structure, then building a WAR file is a very simple extra step.
11 1
12 1
h2. How to build a WAR file.
13 1
14 1
First, build the directory structure of your application. If you're not certain how to build this structure, a simple way forward is to take the demo *modjy_webapp* directory from the jython distribution, and tweak that structure to meet your needs.
15 1
16 1
When you're happy with the contents of the directory hierarchy, execute a command like this, in the top level of your directory hierarchy, e.g. the *modjy_webapp* directory.
17 1
18 1
<pre>
19 1
$JAVA_HOME/bin/jar cvf WARNAME.war .
20 1
</pre>
21 1
22 1
Where WARNAME is the name of the WAR file you want to create, and $JAVA_HOME refers to the location where your JDK or JRE is installed.
23 1
24 1
h2. Django WAR packaging.
25 1
26 1
There is a dedicated page for [[ModjyAndDjango|django and modjy]].
27 1
28 1
h2. Pylons WAR packaging.
29 1
30 2 Alan Kennedy
There is a dedicated page for [[ModjyAndPylons|django and pylons]].