📄 install
字号:
<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 attribute
org.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.xml" file,
changing the value of the "config" initialization parameter (for the
action servlet) from "/WEB-INF/struts-config.xml" to "/struts-config.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-config.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.
SILVERSTREAM APPLICATION SERVER 3.7.1 AND LATER
-----------------------------------------------
Start the SilverStream application server.
Create an XML deployment plan for the "struts-example.war" application.
Call the file "struts-example-depl-plan.xml". You can use the following
contents for the file
----- cut here -----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE warJarOptions PUBLIC
"-//SilverStream Software, Inc.//DTD J2EE WAR Deployment Plan//EN"
"deploy_war.dtd">
<warJarOptions>
<warJar>
<warJarName>struts-example.war</warJarName>
<isEnabled>true</isEnabled>
<urls><el>struts-example</el></urls>
</warJar>
</warJarOptions>
----- cut here -----
Create an XML deployment plan for the "struts-documentation.war"
application.
Call the file "struts-documentation-depl-plan.xml". You can use the
following contents for the file:
----- cut here -----
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE warJarOptions PUBLIC
"-//SilverStream Software, Inc.//DTD J2EE WAR Deployment Plan//EN"
"deploy_war.dtd">
<warJarOptions>
<warJar>
<warJarName>struts-documentation.war</warJarName>
<isEnabled>true</isEnabled>
<urls><el>struts-documentation</el></urls>
</warJar>
</warJarOptions>
----- cut here -----
Run the following "SilverCmd DeployWAR" commands to deploy the applications.
You can change 'localhost' to whatever server you are deploying to. You can
change 'Silvermaster' to whatever database you are deploying to.
SilverCmd DeployWar localhost Silvermaster struts-example.war
-f struts-example-depl-plan.xml
SilverCmd DeployWar localhost Silvermaster struts-documentation.war
-f struts-documentation-depl-plan.xml
TOMCAT 3.1 (OR LATER) WITH APACHE
---------------------------------
* These instructions assume you have successfully integrated
Tomcat with Apache according to the Tomcat documentation.
* Copy "struts-documentation.war" and "struts-example.war"
to your $TOMCAT_HOME/webapps directory
* Restart Tomcat if it is already running
* Tomcat will generate a file "$TOMCAT_HOME/conf/tomcat-apache.conf"
that will be used by Apache. This file is regenerated every time
you start Tomcat, so copy this file to a safe place (such as
your Apache configuration directory; on Unix systems this is usually
"/usr/local/apache/conf".
* If you are running Tomcat 3.1, Tomcat will not have generated the
entries for your new applications. Add the following lines to the
"tomcat-apache.conf" file that you have saved, replacing
$TOMCAT_HOME with the path to your Tomcat home directory:
Alias /struts-documentation "$TOMCAT_HOME/webapps/struts-documentation"
<Directory "$TOMCAT_HOME/webapps/struts-documentation>
Options Indexes FollowSymLinks
</Directory>
ApJServMount /struts-documentation/servlet /struts-documentation
<Location "/struts-documentation/WEB-INF/">
AllowOverride None
deny from all
</Location>
Alias /struts-example "$TOMCAT_HOME/webapps/struts-example"
<Directory "$TOMCAT_HOME/webapps/struts-example>
Options Indexes FollowSymLinks
</Directory>
ApJServMount /struts-example/servlet /struts-example
<Location "/struts-example/WEB-INF/">
AllowOverride None
deny from all
</Location>
* On all versions of Tomcat, the generated file above does not
know anything about extension mappings defined in a web.xml file,
so the "*.do" URIs that go to the controller servlet will not be
recognized. To fix this, add the following line to the saved
version of "tomcat-apache.conf", after the corresponding line
for the .jsp extension:
AddHandler jserv-servlet .do
* Ensure that the saved version of "tomcat-apache.conf" is referenced
in your Apache "httpd.conf" configuration file. A typical use would
have the following line at the bottom of "httpd.conf":
Include /usr/local/apache/conf/tomcat-apache.conf
* In order to recognize "index.jsp" as a default page for web
applications, search in your "httpd.conf" for a "DirectoryIndex"
directive. If you have one, add "index.jsp" to the end of the
list, so that it might look like this:
DirectoryIndex index.html index.jsp
If you do not have such an entry, add one like this:
DirectoryIndex index.jsp
* Restart Apache to make it aware of the new applications. You should
now be able to access the applications from a browser like this:
http://localhost/struts-documentation
http://localhost/struts-example
WEBLOGIC 5.1 (service pack 8)
-----------------------------
* Obtain and install the Xerces XML parser (problems have been reported
with the Sun reference implementation). Put xerces.jar in your WebLogic system
path.
* Obtain and unpack the Struts binary distribution (this procedure assumes
it was extracted to C:\jakarta-struts).
* Add an entry to weblogic.properties for each of the Struts web
applications that you would like to configure. For example, to make the
struts-example application available, add the following line to
weblogic.properties:
weblogic.httpd.webApp.strutsexample=c:/jakarta-struts/webapps/struts-example.war
* You do not need to include struts.jar or any of the application specific
classes in the WebLogic classpath, since this will be done automatically
(unless deploying an unpacked web archive- see below).
* Start WebLogic server and point your web browser to the struts
application. For example, to connect to the example application added in
step 3:
http://localhost:7001/strutsexample
* This example application depends on the Struts specific resource file
ApplicationResources.properties to be present on the classpath. However,
WebLogic only extracts *.class files from the archive so this file will not
be found, resulting in an error the first time it is needed- something
similar to: javax.servlet.ServletException: runtime failure in custom tag
'message'. Steps 6 & 7 will need to be performed for this application, and
any other that relies on ApplicationResources.properties.
* Extract ApplicationResources.properties from the *.war file, and
manually copy it to the respective package in the _tmp_war_ directory
WebLogic created for this application. Again referring to the struts-example
application, this would be:
c:\jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample
* Restart WebLogic. You will now be able to run the application:
http://localhost:7001/strutsexample
* The above steps should be followed for applications deployed as *.war
files. For unpacked web applications, configuration involves adding both
struts.jar and /WEB-INF/classes to the WebLogic classpath. For this reason,
I would suggest deploying applications as war files to WebLogic. However,
the same example application can be successfully deployed in extracted
format by modifying weblogic.properties (assuming the war was extracted to
directory webapps/struts-example):
weblogic.httpd.webApp.strutsexample=c:/jakarta-struts/webapps/struts-example/
And starting WebLogic with the updated WebLogic classpath. For example:
c:\jdk1.3\bin\java -ms16m -mx64m
-classpath c:\weblogic\lib\weblogic510sp8boot.jar;
c:\weblogic\classes\boot;
c:\xerces\xerces.jar -Dweblogic.class.path=c:\weblogic\lib\weblogic510sp8.jar;
c:\weblogic\license;
c:\weblogic\classes;
c:\weblogic\myserver\serverclasses;
c:\weblogic\lib\weblogicaux.jar;
c:\jakarta-struts\lib\struts.jar;
c:\jakarta-struts\webapps\struts-example\WEB-INF\classes
-Dweblogic.system.home=c:\weblogic-Djava.security.manager
-Djava.security.policy=c:\weblogic\weblogic.policyweblogic.Server
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -