Getting Started
|
5.2 Installation | Contributors: |
Installing Struts with your servlet container |
In the steps below, $ORION_HOME refers to the directory in which
you have installed Orion, and $STRUTS_HOME is the directory in
which you unpacked the Struts binary distribution.
- Modify the file
$ORION_HOME/config/application.xml to define
the two new applications, by adding the following declarations, immediately
following the web-module directive for the default web application:
<web-module id="strutsDoc"
path="$STRUTS_HOME/webapps/struts-documentation.war"/>
<web-module id="strutsExample"
path="$STRUTS_HOME/webapps/struts-example.war"/>
- Modify the file
$ORION_HOME/config/default-web-site.xml (or
the configuration file for any other Orion web site) to include the following
declarations, after the declaration for the <default-web-app> if any:
<web-app application="default" name="strutsDoc"
root="/struts-documentation"/>
<web-app application="default" name="strutsExample"
root="/struts-example"/>
- After you start Orion, you should now be able to access these applications
(assuming you haven't changed the port number from the default of 80) at:
http://localhost/struts-documentation
http://localhost/struts-example
- Versions of Orion up to at least 1.0.3 have a bug related to ServletContext.getResource()
calls that prevent the Struts example application from working out of the
box. This manifests itself as a JSP error when you try to access the example
application, with the following message:
javax.servlet.jsp.JspException: Missing resources attributeorg.apache.struts.action.MESSAGE
followed by an error traceback. There will also be an initialization error
message in the ORION_HOME/log/global-application.log log file.
To work around this problem, you can take the following steps:
- Go to the
$STRUTS_HOME/webapps directory, where you will
note that Orion has automatically expanded each web application into an
unpacked directory structure.
- Go to the
$STRUTS_HOME/webapps/struts-example/WEB-INF directory,
and copy the file struts-config.xml one directory up (that
is, into $STRUTS_HOME/webapps/struts-example .
- Modify the
$STRUTS_HOME/webapps/struts-example/WEB-INF/web.xm
file, changing the value of the "config" initialization parameter (for the
action servlet) from /WEB-INF/struts-config.xml to /action.xml .
- Restart Orion, and you should be able to access the example application.
- Note that this workaround has a negative security-related side effect:
your
struts-conifig.xml file can now be retrieved by remote
clients at the following URL:
http://localhost/struts-example/struts-config.xml
Therefore, you should be sure you do not store sensitive information (such
as database passwords) in this file.
Back to Installation
|
|