Table of Contents
List of Examples
A new feature in Enhydra 5.1 Beta is possibility to deploy Enhydra super-servlet application as web archive that uses relative paths.
In previous Enhydra versions user needed to change the path of configuration file in web.xml. Path was absolute, and the change was implemented each time application was deployed to another servlet container.
"Server.ClassPath[]" parameter in configuration file needed to be changed, too, because it contains absolute paths to jar files.
In Enhydra 5.1, user can use relative path to configuration file in web.xml. Path base is WEB-INF directory.
"Server.ClassPath[]" is not obligatory any more. User should place his jars in WEB-INF/lib directory (or class files in WEB-INF/classes), without their explicit declaration in configuration file.
When application is configured by relative paths, WAR can be deployed to any other servlet container (e.g Tomcat 4), without changes.
Next example shows directory structure, web.xml, and position of configuration file and jars of Enhydra 5.1 application:
Example 1.1. Directory structure:
DemoApp/
WEB-INF/
web.xml
DemoApp.conf
classes/
lib/
DemoApp.jar ------ Application jar
core.jar ----+
dods-runtime.jar |
enhydra.jar |
gnu-regexp.jar |
jtidy.jar |
log4j.jar +- Enhydra jars
snoop.jar |
wireless.jar |
xerces.jar |
xhtml.jar |
xmlc.jar |
xmlcSupport.jar ----+
Example 1.2. WEB.XML:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>
enhydra
</servlet-name>
<servlet-class>
com.lutris.appserver.server.httpPresentation.servlet.HttpPresentationServlet
</servlet-class>
<init-param>
<param-name>ConfFile
</param-name>
<param-value>DemoApp.conf</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>enhydra</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
Example 1.3. DemoApp.conf (part):
...
#
# Comma separated CLASSPATH directories and files used by this application.
#
#Server.ClassPath[] =
#
...
Note that "Server.ClassPath[] =" line is commented.
If your Enhydra application uses DODS on any other servlet container (e.g. Tomcat 4), JVM enviroment variable DODS_HOME must be set to point on your DODS installation, when starting servlet container. On Tomcat 4 (on Windows) just need to edit ${tomcat_root}/bin/startup.bat file. Add this line before "call "%EXECUTABLE%" run %CMD_LINE_ARGS%" (if your DODS installation root dir is c:\dods):
set JAVA_OPTS=%JAVA_OPTS% -DDODS_HOME=c:\dods