<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>The Struts Framework Project - Installation - Weblogic 5.1 sp8</title> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="Robert Hayden" name="author" /> <meta content="Wong Kok Kai" name="author" /> <link href="../struts.css" type="text/css" rel="stylesheet" /> </head> <body> <div id="heading"> <a href="http://apache.org/"> <img id="asf_logo_wide" alt="The Apache Project" src="../images/asf_logo_wide.gif" /> </a> <a href="http://struts.apache.org/"> <img id="struts-logo" alt="Struts Framework" src="../images/struts.gif" /> </a> </div> <!--end heading--> <div id="content"> <div id="menu"> <p>User Guide</p> <ul> <li> <a href="index.html">Table of Contents</a> </li> <li> <a href="preface.html">Preface</a> </li> <li> <a href="introduction.html">Introduction</a> </li> <li> <a href="building_model.html">Model Components</a> </li> <li> <a href="building_view.html">View Components</a> </li> <li> <a href="building_controller.html">Controller Components</a> </li> <li> <a href="configuration.html">Configuration</a> </li> <li> <a href="release-notes.html">Release Notes</a> </li> <li> <a href="installation.html">Installation</a> </li> </ul> <p>Developer Guides</p> <ul> <li> <a href="dev_bean.html">Bean Tags</a> </li> <li> <a href="dev_html.html">HTML Tags</a> </li> <li> <a href="dev_logic.html">Logic Tags</a> </li> <li> <a href="dev_nested.html">Nested Tags</a> </li> <li> <a href="dev_tiles.html">Tiles Tags</a> </li> <li> <a href="dev_util.html">Utilities</a> </li> <li> <a href="dev_validator.html">Validator</a> </li> </ul> <p>Quick Links</p> <ul> <li> <a href="../index.html">Welcome</a> </li> <li> <a href="index.html">User and Developer Guides *</a> </li> <li> <a href="../faqs/index.html">FAQs and HowTos</a> </li> </ul> <div class="authors"> <p> <strong>Contributors</strong> </p> <ul> <li>Robert Hayden</li> <li>Wong Kok Kai</li> </ul> </div> </div> <!--end menu--> <div id="main"> <h1 id="installation">5.2 Installation</h1> <h2 id="Containers">Installing Struts with your servlet container</h2> <div class="indent"> <h4 id="wls5">Weblogic 5.1 (service pack 8)</h4> <ul> <li>Obtain and install the Xerces XML parser (problems have been reported with the Sun reference implementation). Put xerces.jar in your WebLogic system path.</li> <li>Obtain and unpack the Struts binary distribution (this procedure assumes it was extracted to <code>c:\jakarta-struts</code>).</li> <li>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:<br /> <code>weblogic.httpd.webApp.strutsexample=<br /> c:/jakarta-struts/webapps/struts-example.war</code> </li> <li>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).</li> <li>Start WebLogic server and point your web browser to the struts application. For example, to connect to the example application added in step 3:<br /> <code>http://localhost:7001/strutsexample</code> </li> <li>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.</li> <li>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:<br /> <code>c:\jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample</code> </li> <li>Restart WebLogic. You will now be able to run the application:<br /> <code>http://localhost:7001/strutsexample</code> </li> </ul> <p>The above steps should be followed for applications deployed as *.war files. For unpacked web applications, configuration involves adding both <code>struts.jar</code> and <code>/WEB-INF/classes</code> 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):</p> <p> <code>weblogic.httpd.webApp.strutsexample=<br /> c:/jakarta-struts/webapps/struts-example/</code> </p> <p>And starting WebLogic with the updated WebLogic classpath. For example:</p> <p> <code>c:\jdk1.3\bin\java -ms16m -mx64m<br /> -classpath c:\weblogic\lib\weblogic510sp8boot.jar;</code> </p> <hr /> <h4>Additional Recommendations</h4> <ul> <li>Servlet and JSP-Reloading should be turned off. First, you pay a performance penalty. Depending on the number of JSPs, the number of requests and the configured checking interval, the server will slow down. Second, with JSP- and Servlet reloading, one opens the door for various Weblogic classloader problems, that are difficult to diagnose, difficult to handle and often lead to lost HTTP-sessions.</li> <li>Set the name of the <code>sessionid</code> to <code>JSESSIONID</code>, if cookies are used for session tracking and to jsessionid, if sessions are URL-based. (There are additional problems related to URL-based sessions, caused from BEA's way to encode the session id (J2EE-incompatible) as query-param. Especially <bean:include> will not work with URL-based sessions yet. However, using the correct session name solves at least some problems.)</li> <li>Configure the JSP-Servlet registration in <code>weblogic.properties</code> for maximum J2EE-compliance and/or for maximum performance.</li> </ul> <p>The JSP-Servlet supports some initialization parameters that can be customized to get best performance, maximum compliance or (as shown below) easier debugging:</p> <pre> weblogic.httpd.initArgs.*.jsp=\ pageCheckSeconds=-1,\ setEmptyStrings=false,\ compileCommand=./_jspCompiler_.cmd,\ workingDir=/weblogic/myserver/tmp_classfiles,\ keepgenerated=true,\ debug=true,\ verbose=true </pre> <p>In the above example, the batch file (<code>_jspCompiler_.cmd</code>) invokes jikes which results dramatically reduced startup times (jikes is about three times faster than javac.) The batchfile contains only a single line:</p> <pre>@jikes -g -nowarn %*</pre> <p>The next configuration could be used when all tests have been done and speed is the major concern ...</p> <pre> weblogic.httpd.initArgs.*.jsp=\ pageCheckSeconds=-1,\ setEmptyStrings=false,\ compileCommand=./_jspCompiler_.cmd,\ workingDir=/weblogic/myserver/tmp_classfiles,\ keepgenerated=false,\ debug=false,\ verbose=false </pre> <p>... together with ...</p> <pre>@jikes -O -nowarn %*</pre> <p>Weblogic supports similar settings through <code><context-params></code> in <code>web.xml</code> (Please read the latest documentation at the BEA website for details.)</p> <p>For additional issues, see also <a href="http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg00284.html">More fixes for WLS 5.1 SP8</a> from the Struts Developer mailing list</p> <hr /> <ul> <li>Author: Robert Hayden</li> <li>Author: Wong Kok Kai</li> <li>Author: Matthias Kerkhoff </li> </ul> <hr /> <p>Back to <a href="installation.html#Containers">Installation</a> </p> </div> </div> <!--end main--> </div> <!--end content--> <div id="footer"> <img id="powered-logo" alt="Powered by Struts" src="../images/struts-power.gif" /> Copyright (c) 2000-2005, The Apache Software Foundation <span class="noprint">- <a href="http://wiki.apache.org/struts/StrutsDocComments">Comments?</a> </span> </div> <!--end footer--> </body> </html>