|
RIFE : Preparing applications for production
This page last changed on Feb 09, 2007 by spector@zeitgeist.com.
Check ListCode ChecksBefore trying to build your application's WAR file, take a few moments to check your files and code for the following criteria:
Build.xml Changes/Customizations
found near the top of the file should be changed to reflect the name of your application. The result will be a JAR or WAR file with your application's name instead of "rife-jumpstart"
ConfigurationFirst, set these configuration parameters to false, their purpose should be self-explanatory: <param name="ELEMENT_AUTO_RELOAD">false</param> <param name="SITE_AUTO_RELOAD">false</param> <param name="TEMPLATE_AUTO_RELOAD">false</param> <param name="L10N_RESOURCEBUNDLE_AUTO_RELOAD">false</param> By disabling all these parameters, RIFE will not automatically check for changes in these file types and your application will run at full-speed. Note that when you set up you repository configuration participant like this: <participant param="XmlSelectorHostname">ParticipantConfig</participant> You can create configuration files that are specific for each host (development, production, ...). In each of these files you can then set the appropriate configuration parameters and still include a common configuration file that contains all the application settings. This site for example has the following configuration files: src/
rep/
config-common.xml
config-dawn_uwyn_com.xml
config-elm_uwyn_office.xml
config-ferrari_uwyn_office.xml
config-pine_uwyn_office.xml
The host dawn.uwyn.com is the production server and all the others are development machines. They all include config-common.xml. PackagingNext, you should pre-compile all your templates during the packaging of your web application. This is handled by the com.uwyn.rife.template.TemplateDeployer class. You will typically do this in your Ant build process, this is an example, taken from the Rife-JumpStart package, of a task that does just that: <target name="precompile"> <echo message="Precompiling html templates:"/> <java classname="com.uwyn.rife.template.TemplateDeployer" failonerror="true" fork="true"> <arg value="-verbose"/> <arg value="-t"/> <arg value="enginehtml"/> <arg value="-d"/> <arg value="${build.classes}"/> <arg value="-encoding"/> <arg value="UTF-8"/> <arg value="${templates.dir}"/> <classpath refid="application.classpath"/> <classpath refid="lib.classpath"/> </java> </target> You will need to do this for each template type that you use. After this process, your templates will be regular Java classes and will not have to be parsed during production anymore. Your application will thus respond instantly once it has been started up. |
| Document generated by Confluence on Oct 19, 2010 14:57 |