http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/processes.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/processes.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/processes.html new file mode 100644 index 0000000..fa619a1 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/processes.html @@ -0,0 +1,289 @@ +<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Application Developer's Guide - Development Processes</title><meta content="Craig R. McClanahan" name="author"><style media="print" type="text/css"> + .noPrint {display: none;} + td#mainBody {width: 100%;} + </style></head><body vlink="#525D76" alink="#525D76" link="#525D76" text="#000000" bgcolor="#ffffff"><table cellspacing="0" width="100%" border="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img border="0" alt=" + The Apache Tomcat Servlet/JSP Container + " align="right" src="../images/tomcat.gif"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img border="0" alt="Apache Logo" align="right" src="../images/asf-logo.gif"></a></td></tr></table><table cellspacing="4" width="100%" border="0"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><tr><!--LEFT SIDE NAVIGATION--><td class="noPrint" nowrap valign="top" width="20%"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li></ul><p><strong>Contents</strong></p><ul><li><a href="index.html">Contents</a></li><li><a href="introduction.html">Introduction</a></li><li><a href="installation.html">Installation</a></li><li><a href="deployment.html">Deployment</a></li><li><a href="source.html">Source Code</a></li><li><a href="processes.html">Processes</a></li><li><a href="sample/">Example App</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td id="mainBo dy" align="left" valign="top" width="80%"><h1>Application Developer's Guide</h1><h2>Development Processes</h2><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote> +<ul><li><a href="#Development_Processes">Development Processes</a><ol><li><a href="#One-Time_Setup_of_Ant_and_Tomcat_for_Development">One-Time Setup of Ant and Tomcat for Development</a></li><li><a href="#Create_Project_Source_Code_Directory">Create Project Source Code Directory</a></li><li><a href="#Edit_Source_Code_and_Pages">Edit Source Code and Pages</a></li><li><a href="#Build_the_Web_Application">Build the Web Application</a></li><li><a href="#Test_Your_Web_Application">Test Your Web Application</a></li><li><a href="#Creating_a_Release">Creating a Release</a></li></ol></li></ul> +</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Development Processes"><!--()--></a><a name="Development_Processes"><strong>Development Processes</strong></a></font></td></tr><tr><td><blockquote> + +<p>Although application development can take many forms, this manual proposes +a fairly generic process for creating web applications using Tomcat. The +following sections highlight the commands and tasks that you, as the developer +of the code, will perform. The same basic approach works when you have +multiple programmers involved, as long as you have an appropriate source code +control system and internal team rules about who is working on what parts +of the application at any given time.</p> + +<p>The task descriptions below assume that you will be using CVS for source +code control, and that you have already configured access to the appropriate +CVS repository. Instructions for doing this are beyond the scope of this +manual. If you are using a different source code control environment, you +will need to figure out the corresponding commands for your system.</p> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="One-Time Setup of Ant and Tomcat for Development"><!--()--></a><a name="One-Time_Setup_of_Ant_and_Tomcat_for_Development"><strong>One-Time Setup of Ant and Tomcat for Development</strong></a></font></td></tr><tr><td><blockquote> + +<p>In order to take advantage of the special Ant tasks that interact with the +<em>Manager</em> web application, you need to perform the following tasks +once (no matter how many web applications you plan to develop).</p> +<ul> +<li><em>Configure the Ant custom tasks</em>. The implementation code for the + Ant custom tasks is in a JAR file named + <code>$CATALINA_HOME/lib/catalina-ant.jar</code>, which must be + copied in to the <code>lib</code> directory of your Ant installation. + <br><br></li> +<li><em>Define one or more Tomcat users</em>. The <em>Manager</em> web + application runs under a security constraint that requires a user to be + logged in, and have the security role <code>manager</code> assigned to + him or her. How such users are defined depends on which Realm you have + configured in Tomcat's <code>conf/server.xml</code> file -- see the + <a href="../realm-howto.html">Realm Configuration HOW-TO</a> for more + information. You may define any number of users (with any username + and password that you like) with the <code>manager</code> role. + <br><br></li> +</ul> + +</blockquote></td></tr></table> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Create Project Source Code Directory"><!--()--></a><a name="Create_Project_Source_Code_Directory"><strong>Create Project Source Code Directory</strong></a></font></td></tr><tr><td><blockquote> + +<p>The first step is to create a new project source directory, and customize +the <code>build.xml</code> and <code>build.properties</code> files you will +be using. The directory structure is described in <a href="source.html">the +previous section</a>, or you can use the +<a href="sample/">sample application</a> as a starting point.</p> + +<p>Create your project source directory, and define it within your CVS +repository. This might be done by a series of commands like this, where +<code>{project}</code> is the name under which your project should be +stored in the CVS repository, and {username} is your login username:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +mkdir myapp <-- Assumed "project source directory" +cd myapp +mkdir docs +mkdir src +mkdir web +mkdir web/WEB-INF +cvs import -m "Initial Project Creation" {project} \ + {username} start +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>Now, to verify that it was created correctly in CVS, we will perform a +checkout of the new project:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd .. +mv myapp myapp.bu +cvs checkout {project} +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>Next, you will need to create and check in an initial version of the +<code>build.xml</code> script to be used for development. For getting +started quickly and easily, base your <code>build.xml</code> on the +<a href="build.xml.txt">basic build.xml file</a>, included with this manual, +or code it from scratch.</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp +emacs build.xml <-- if you want a real editor :-) +cvs add build.xml +cvs commit +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>Until you perform the CVS commit, your changes are local to your own +development directory. Committing makes those changes visible to other +developers on your team that are sharing the same CVS repository.</p> + +<p>The next step is to customize the Ant <em>properties</em> that are +named in the <code>build.xml</code> script. This is done by creating a +file named <code>build.properties</code> in your project's top-level +directory. The supported properties are listed in the comments inside +the sample <code>build.xml</code> script. At a minimum, you will generally +need to define the <code>catalina.home</code> property defining where +Tomcat 6 is installed, and the manager application username and password. +You might end up with something like this:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +# Context path to install this application on +app.path=/hello + +# Tomcat 6 installation directory +catalina.home=/usr/local/apache-tomcat-6.0 + +# Manager webapp username and password +manager.username=myusername +manager.password=mypassword +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>In general, you will <strong>not</strong> want to check the +<code>build.properties</code> file in to the CVS repository, because it +is unique to each developer's environment.</p> + +<p>Now, create the initial version of the web application deployment +descriptor. You can base <code>web.xml</code> on the +<a href="web.xml.txt">basic web.xml file</a>, or code it from scratch.</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp/web/WEB-INF +emacs web.xml +cvs add web.xml +cvs commit +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +Note that this is only an example web.xml file. The full definition +of the deployment descriptor file is in the +<a href="http://java.sun.com/products/servlet">Servlet Specification.</a> + +</blockquote></td></tr></table> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Edit Source Code and Pages"><!--()--></a><a name="Edit_Source_Code_and_Pages"><strong>Edit Source Code and Pages</strong></a></font></td></tr><tr><td><blockquote> + +<p>The edit/build/test tasks will generally be your most common activities +during development and maintenance. The following general principles apply. +As described in <a href="source.html">Source Organization</a>, newly created +source files should be located in the appropriate subdirectory, under your +project source directory.</p> + +<p>Whenever you wish to refresh your development directory to reflect the +work performed by other developers, you will ask CVS to do it for you:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp +cvs update -dP +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>To create a new file, go to the appropriate directory, create the file, +and register it with CVS. When you are satisfied with it's contents (after +building and testing is successful), commit the new file to the repository. +For example, to create a new JSP page:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp/web <-- Ultimate destination is document root +emacs mypage.jsp +cvs add mypage.jsp +... build and test the application ... +cvs commit +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>Java source code that is defined in packages must be organized in a +directory hierarchy (under the <strong>src/</strong> subdirectory) that +matches the package names. For example, a Java class named +<code>com.mycompany.mypackage.MyClass.java</code> should be stored in file +<code>src/com/mycompany/mypackage/MyClass.java</code>. +Whenever you create a new subdirectory, don't forget to +register it with CVS.</p> + +<p>To edit an existing source file, you will generally just start editing +and testing, then commit the changed file when everything works. Although +CVS can be configured to required you to "check out" or "lock" a file you +are going to be modifying, this is generally not used.</p> + +</blockquote></td></tr></table> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Build the Web Application"><!--()--></a><a name="Build_the_Web_Application"><strong>Build the Web Application</strong></a></font></td></tr><tr><td><blockquote> + +<p>When you are ready to compile the application, issue the following +commands (generally, you will want a shell window open that is set to +the project source directory, so that only the last command is needed):</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp <-- Normally leave a window open here +ant +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>The Ant tool will be execute the default "compile" target in your +<code>build.xml</code> file, which will compile any new or updated Java +code. If this is the first time you compile after a "build clean", +it will cause everything to be recompiled.</p> + +<p>To force the recompilation of your entire application, do this instead:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +cd {my home directory} +cd myapp +ant all +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>This is a very good habit immediately before checking in changes, to +make sure that you have not introduced any subtle problems that Javac's +conditional checking did not catch.</p> + +</blockquote></td></tr></table> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Test Your Web Application"><!--()--></a><a name="Test_Your_Web_Application"><strong>Test Your Web Application</strong></a></font></td></tr><tr><td><blockquote> + +<p>To test your application, you will want to install it under Tomcat. The +quickest way to do that is to use the custom Ant tasks that are included in +the sample <code>build.xml</code> script. Using these commands might follow +a pattern like this:</p> +<ul> +<li><em>Start Tomcat 6 if needed</em>. If Tomcat 6 is not already running, + you will need to start it in the usual way. + <br><br></li> +<li><em>Compile your application</em>. Use the <code>ant compile</code> + command (or just <code>ant</code>, since this is the default). Make + sure that there are no compilation errors. + <br><br></li> +<li><em>Install the application</em>. Use the <code>ant install</code> + command. This tells Tomcat to immediately start running your app on + the context path defined in the <code>app.path</code> build property. + Tomcat does <strong>NOT</strong> have to be restarted for this to + take effect.<br><br></li> +<li><em>Test the application</em>. Using your browser or other testing + tools, test the functionality of your application. + <br><br></li> +<li><em>Modify and rebuild as needed</em>. As you discover that changes + are required, make those changes in the original <strong>source</strong> + files, not in the output build directory, and re-issue the + <code>ant compile</code> command. This ensures that your changes will + be available to be saved (via <code>cvs commit</code>) later on -- + the output build directory is deleted and recreated as necessary. + <br><br></li> +<li><em>Reload the application</em>. Tomcat will recognize changes in + JSP pages automatically, but it will continue to use the old versions + of any servlet or JavaBean classes until the application is reloaded. + You can trigger this by executing the <code>ant reload</code> command. + <br><br></li> +<li><em>Remove the application when you re done</em>. When you are through + working on this application, you can remove it from live execution by + running the <code>ant remove</code> command.</li> +</ul> + +<p>Do not forget to commit your changes to the source code repository when +you have completed your testing!</p> + +</blockquote></td></tr></table> + + +<table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Creating a Release"><!--()--></a><a name="Creating_a_Release"><strong>Creating a Release</strong></a></font></td></tr><tr><td><blockquote> + +<p>When you are through adding new functionality, and you've tested everything +(you DO test, don't you :-), it is time to create the distributable version +of your web application that can be deployed on the production server. The +following general steps are required:</p> +<ul> +<li>Issue the command <code>ant all</code> from the project source + directory, to rebuild everything from scratch one last time. + <br><br></li> +<li>Use the <code>cvs tag</code> command to create an identifier for + all of the source files utilized to create this release. This allows + you to reliably reconstruct a release (from sources) at a later + time.</li> +<li>Issue the command <code>ant dist</code> to create a distributable + web application archive (WAR) file, as well as a JAR file containing + the corresponding source code. + <br><br></li> +<li>Package the contents of the <code>dist</code> directory using the + <strong>tar</strong> or <strong>zip</strong> utility, according to + the standard release procedures used by your organization.</li> +</ul> + +</blockquote></td></tr></table> + + +</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em> + Copyright © 1999-2010, Apache Software Foundation + </em></font></div></td></tr></table></body></html> \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/build.xml ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/build.xml b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/build.xml new file mode 100644 index 0000000..7201a50 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/build.xml @@ -0,0 +1,514 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!-- + General purpose build script for web applications and web services, + including enhanced support for deploying directly to a Tomcat 6 + based server. + + This build script assumes that the source code of your web application + is organized into the following subdirectories underneath the source + code directory from which you execute the build script: + + docs Static documentation files to be copied to + the "docs" subdirectory of your distribution. + + src Java source code (and associated resource files) + to be compiled to the "WEB-INF/classes" + subdirectory of your web application. + + web Static HTML, JSP, and other content (such as + image files), including the WEB-INF subdirectory + and its configuration file contents. + + $Id: build.xml.txt 785727 2009-06-17 17:03:57Z kkolinko $ +--> + + +<!-- A "project" describes a set of targets that may be requested + when Ant is executed. The "default" attribute defines the + target which is executed if no specific target is requested, + and the "basedir" attribute defines the current working directory + from which Ant executes the requested task. This is normally + set to the current working directory. +--> + +<project name="My Project" default="compile" basedir="."> + + + +<!-- ===================== Property Definitions =========================== --> + + +<!-- + + Each of the following properties are used in the build script. + Values for these properties are set by the first place they are + defined, from the following list: + + * Definitions on the "ant" command line (ant -Dfoo=bar compile). + + * Definitions from a "build.properties" file in the top level + source directory of this application. + + * Definitions from a "build.properties" file in the developer's + home directory. + + * Default definitions in this build.xml file. + + You will note below that property values can be composed based on the + contents of previously defined properties. This is a powerful technique + that helps you minimize the number of changes required when your development + environment is modified. Note that property composition is allowed within + "build.properties" files as well as in the "build.xml" script. + +--> + + <property file="build.properties"/> + <property file="${user.home}/build.properties"/> + + +<!-- ==================== File and Directory Names ======================== --> + + +<!-- + + These properties generally define file and directory names (or paths) that + affect where the build process stores its outputs. + + app.name Base name of this application, used to + construct filenames and directories. + Defaults to "myapp". + + app.path Context path to which this application should be + deployed (defaults to "/" plus the value of the + "app.name" property). + + app.version Version number of this iteration of the application. + + build.home The directory into which the "prepare" and + "compile" targets will generate their output. + Defaults to "build". + + catalina.home The directory in which you have installed + a binary distribution of Tomcat 6. This will + be used by the "deploy" target. + + dist.home The name of the base directory in which + distribution files are created. + Defaults to "dist". + + manager.password The login password of a user that is assigned the + "manager" role (so that he or she can execute + commands via the "/manager" web application) + + manager.url The URL of the "/manager" web application on the + Tomcat installation to which we will deploy web + applications and web services. + + manager.username The login username of a user that is assigned the + "manager" role (so that he or she can execute + commands via the "/manager" web application) + +--> + + <property name="app.name" value="myapp"/> + <property name="app.path" value="/${app.name}"/> + <property name="app.version" value="0.1-dev"/> + <property name="build.home" value="${basedir}/build"/> + <property name="catalina.home" value="../../../.."/> <!-- UPDATE THIS! --> + <property name="dist.home" value="${basedir}/dist"/> + <property name="docs.home" value="${basedir}/docs"/> + <property name="manager.url" value="http://localhost:8080/manager"/> + <property name="src.home" value="${basedir}/src"/> + <property name="web.home" value="${basedir}/web"/> + + +<!-- ==================== External Dependencies =========================== --> + + +<!-- + + Use property values to define the locations of external JAR files on which + your application will depend. In general, these values will be used for + two purposes: + * Inclusion on the classpath that is passed to the Javac compiler + * Being copied into the "/WEB-INF/lib" directory during execution + of the "deploy" target. + + Because we will automatically include all of the Java classes that Tomcat 6 + exposes to web applications, we will not need to explicitly list any of those + dependencies. You only need to worry about external dependencies for JAR + files that you are going to include inside your "/WEB-INF/lib" directory. + +--> + +<!-- Dummy external dependency --> +<!-- + <property name="foo.jar" + value="/path/to/foo.jar"/> +--> + + +<!-- ==================== Compilation Classpath =========================== --> + +<!-- + + Rather than relying on the CLASSPATH environment variable, Ant includes + features that makes it easy to dynamically construct the classpath you + need for each compilation. The example below constructs the compile + classpath to include the servlet.jar file, as well as the other components + that Tomcat makes available to web applications automatically, plus anything + that you explicitly added. + +--> + + <path id="compile.classpath"> + + <!-- Include all JAR files that will be included in /WEB-INF/lib --> + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> +<!-- + <pathelement location="${foo.jar}"/> +--> + + <!-- Include all elements that Tomcat exposes to applications --> + <fileset dir="${catalina.home}/bin"> + <include name="*.jar"/> + </fileset> + <pathelement location="${catalina.home}/lib"/> + <fileset dir="${catalina.home}/lib"> + <include name="*.jar"/> + </fileset> + + </path> + + + +<!-- ================== Custom Ant Task Definitions ======================= --> + + +<!-- + + These properties define custom tasks for the Ant build tool that interact + with the "/manager" web application installed with Tomcat 6. Before they + can be successfully utilized, you must perform the following steps: + + - Copy the file "lib/catalina-ant.jar" from your Tomcat 6 + installation into the "lib" directory of your Ant installation. + + - Create a "build.properties" file in your application's top-level + source directory (or your user login home directory) that defines + appropriate values for the "manager.password", "manager.url", and + "manager.username" properties described above. + + For more information about the Manager web application, and the functionality + of these tasks, see <http://localhost:8080/tomcat-docs/manager-howto.html>. + +--> + + <taskdef resource="org/apache/catalina/ant/catalina.tasks" + classpathref="compile.classpath"/> + + +<!-- ==================== Compilation Control Options ==================== --> + +<!-- + + These properties control option settings on the Javac compiler when it + is invoked using the <javac> task. + + compile.debug Should compilation include the debug option? + + compile.deprecation Should compilation include the deprecation option? + + compile.optimize Should compilation include the optimize option? + +--> + + <property name="compile.debug" value="true"/> + <property name="compile.deprecation" value="false"/> + <property name="compile.optimize" value="true"/> + + + +<!-- ==================== All Target ====================================== --> + +<!-- + + The "all" target is a shortcut for running the "clean" target followed + by the "compile" target, to force a complete recompile. + +--> + + <target name="all" depends="clean,compile" + description="Clean build and dist directories, then compile"/> + + + +<!-- ==================== Clean Target ==================================== --> + +<!-- + + The "clean" target deletes any previous "build" and "dist" directory, + so that you can be ensured the application can be built from scratch. + +--> + + <target name="clean" + description="Delete old build and dist directories"> + <delete dir="${build.home}"/> + <delete dir="${dist.home}"/> + </target> + + + +<!-- ==================== Compile Target ================================== --> + +<!-- + + The "compile" target transforms source files (from your "src" directory) + into object files in the appropriate location in the build directory. + This example assumes that you will be including your classes in an + unpacked directory hierarchy under "/WEB-INF/classes". + +--> + + <target name="compile" depends="prepare" + description="Compile Java sources"> + + <!-- Compile Java classes as necessary --> + <mkdir dir="${build.home}/WEB-INF/classes"/> + <javac srcdir="${src.home}" + destdir="${build.home}/WEB-INF/classes" + debug="${compile.debug}" + deprecation="${compile.deprecation}" + optimize="${compile.optimize}"> + <classpath refid="compile.classpath"/> + </javac> + + <!-- Copy application resources --> + <copy todir="${build.home}/WEB-INF/classes"> + <fileset dir="${src.home}" excludes="**/*.java"/> + </copy> + + </target> + + + +<!-- ==================== Dist Target ===================================== --> + + +<!-- + + The "dist" target creates a binary distribution of your application + in a directory structure ready to be archived in a tar.gz or zip file. + Note that this target depends on two others: + + * "compile" so that the entire web application (including external + dependencies) will have been assembled + + * "javadoc" so that the application Javadocs will have been created + +--> + + <target name="dist" depends="compile,javadoc" + description="Create binary distribution"> + + <!-- Copy documentation subdirectories --> + <mkdir dir="${dist.home}/docs"/> + <copy todir="${dist.home}/docs"> + <fileset dir="${docs.home}"/> + </copy> + + <!-- Create application JAR file --> + <jar jarfile="${dist.home}/${app.name}-${app.version}.war" + basedir="${build.home}"/> + + <!-- Copy additional files to ${dist.home} as necessary --> + + </target> + + + +<!-- ==================== Install Target ================================== --> + +<!-- + + The "install" target tells the specified Tomcat 6 installation to dynamically + install this web application and make it available for execution. It does + *not* cause the existence of this web application to be remembered across + Tomcat restarts; if you restart the server, you will need to re-install all + this web application. + + If you have already installed this application, and simply want Tomcat to + recognize that you have updated Java classes (or the web.xml file), use the + "reload" target instead. + + NOTE: This target will only succeed if it is run from the same server that + Tomcat is running on. + + NOTE: This is the logical opposite of the "remove" target. + +--> + + <target name="install" depends="compile" + description="Install application to servlet container"> + + <deploy url="${manager.url}" + username="${manager.username}" + password="${manager.password}" + path="${app.path}" + localWar="file://${build.home}"/> + + </target> + + +<!-- ==================== Javadoc Target ================================== --> + +<!-- + + The "javadoc" target creates Javadoc API documentation for the Java + classes included in your application. Normally, this is only required + when preparing a distribution release, but is available as a separate + target in case the developer wants to create Javadocs independently. + +--> + + <target name="javadoc" depends="compile" + description="Create Javadoc API documentation"> + + <mkdir dir="${dist.home}/docs/api"/> + <javadoc sourcepath="${src.home}" + destdir="${dist.home}/docs/api" + packagenames="*"> + <classpath refid="compile.classpath"/> + </javadoc> + + </target> + + + +<!-- ====================== List Target =================================== --> + +<!-- + + The "list" target asks the specified Tomcat 6 installation to list the + currently running web applications, either loaded at startup time or + installed dynamically. It is useful to determine whether or not the + application you are currently developing has been installed. + +--> + + <target name="list" + description="List installed applications on servlet container"> + + <list url="${manager.url}" + username="${manager.username}" + password="${manager.password}"/> + + </target> + + +<!-- ==================== Prepare Target ================================== --> + +<!-- + + The "prepare" target is used to create the "build" destination directory, + and copy the static contents of your web application to it. If you need + to copy static files from external dependencies, you can customize the + contents of this task. + + Normally, this task is executed indirectly when needed. + +--> + + <target name="prepare"> + + <!-- Create build directories as needed --> + <mkdir dir="${build.home}"/> + <mkdir dir="${build.home}/WEB-INF"/> + <mkdir dir="${build.home}/WEB-INF/classes"/> + + + <!-- Copy static content of this web application --> + <copy todir="${build.home}"> + <fileset dir="${web.home}"/> + </copy> + + <!-- Copy external dependencies as required --> + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> + <mkdir dir="${build.home}/WEB-INF/lib"/> +<!-- + <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/> +--> + + <!-- Copy static files from external dependencies as needed --> + <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** --> + + </target> + + +<!-- ==================== Reload Target =================================== --> + +<!-- + + The "reload" signals the specified application Tomcat 6 to shut itself down + and reload. This can be useful when the web application context is not + reloadable and you have updated classes or property files in the + /WEB-INF/classes directory or when you have added or updated jar files in the + /WEB-INF/lib directory. + + NOTE: The /WEB-INF/web.xml web application configuration file is not reread + on a reload. If you have made changes to your web.xml file you must stop + then start the web application. + +--> + + <target name="reload" depends="compile" + description="Reload application on servlet container"> + + <reload url="${manager.url}" + username="${manager.username}" + password="${manager.password}" + path="${app.path}"/> + + </target> + + +<!-- ==================== Remove Target =================================== --> + +<!-- + + The "remove" target tells the specified Tomcat 6 installation to dynamically + remove this web application from service. + + NOTE: This is the logical opposite of the "install" target. + +--> + + <target name="remove" + description="Remove application on servlet container"> + + <undeploy url="${manager.url}" + username="${manager.username}" + password="${manager.password}" + path="${app.path}"/> + + </target> + + +</project> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/docs/README.txt ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/docs/README.txt b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/docs/README.txt new file mode 100644 index 0000000..f146b0e --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/docs/README.txt @@ -0,0 +1,17 @@ + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +This is a dummy README file for the sample +web application. http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/index.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/index.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/index.html new file mode 100644 index 0000000..8a67a7d --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/index.html @@ -0,0 +1,46 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<html> +<head> +<meta name="author" content="Ben Souther" /> +<title>Sample Application</title> +</head> +<body> +<h2>Sample Application</h2> + <p> + The example app has been packaged as a war file and can be downloaded + <a href="sample.war">here</a> (Note: make sure your browser doesn't + change file extension or append a new one). + </p> + <p> + The easiest way to run this application is simply to move the war file + to your <b>CATALINA_HOME/webapps</b> directory. Tomcat will automatically + expand and deploy the application for you. You can view it with the + following URL (assuming that you're running tomcat on port 8080 + as is the default): + <br /> + <a href="http://localhost:8080/sample">http://localhost:8080/sample</a> + </p> + <p> + If you just want to browse the contents, you can unpack the war file + with the <b>jar</b> command. + <source> + jar -xvf sample.war + </source> + </p> +</body> +</html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/sample.war ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/sample.war b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/sample.war new file mode 100644 index 0000000..0a127e6 Binary files /dev/null and b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/sample.war differ http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/src/mypackage/Hello.java ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/src/mypackage/Hello.java b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/src/mypackage/Hello.java new file mode 100644 index 0000000..ebc9381 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/src/mypackage/Hello.java @@ -0,0 +1,83 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package mypackage; + +import java.io.IOException; +import java.io.PrintWriter; +import java.util.Enumeration; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * Simple servlet to validate that the Hello, World example can + * execute servlets. In the web application deployment descriptor, + * this servlet must be mapped to correspond to the link in the + * "index.html" file. + * + * @author Craig R. McClanahan <[email protected]> + */ + +public final class Hello extends HttpServlet { + + + /** + * Respond to a GET request for the content produced by + * this servlet. + * + * @param request The servlet request we are processing + * @param response The servlet response we are producing + * + * @exception IOException if an input/output error occurs + * @exception ServletException if a servlet error occurs + */ + public void doGet(HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + + response.setContentType("text/html"); + PrintWriter writer = response.getWriter(); + + writer.println("<html>"); + writer.println("<head>"); + writer.println("<title>Sample Application Servlet Page</title>"); + writer.println("</head>"); + writer.println("<body bgcolor=white>"); + + writer.println("<table border=\"0\">"); + writer.println("<tr>"); + writer.println("<td>"); + writer.println("<img src=\"images/tomcat.gif\">"); + writer.println("</td>"); + writer.println("<td>"); + writer.println("<h1>Sample Application Servlet</h1>"); + writer.println("This is the output of a servlet that is part of"); + writer.println("the Hello, World application."); + writer.println("</td>"); + writer.println("</tr>"); + writer.println("</table>"); + + writer.println("</body>"); + writer.println("</html>"); + + } + + +} http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/WEB-INF/web.xml b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/WEB-INF/web.xml new file mode 100644 index 0000000..8162489 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/WEB-INF/web.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4"> + + <display-name>Hello, World Application</display-name> + <description> + This is a simple web application with a source code organization + based on the recommendations of the Application Developer's Guide. + </description> + + <servlet> + <servlet-name>HelloServlet</servlet-name> + <servlet-class>mypackage.Hello</servlet-class> + </servlet> + + <servlet-mapping> + <servlet-name>HelloServlet</servlet-name> + <url-pattern>/hello</url-pattern> + </servlet-mapping> + +</web-app> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/hello.jsp ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/hello.jsp b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/hello.jsp new file mode 100644 index 0000000..0f23637 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/hello.jsp @@ -0,0 +1,39 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<html> +<head> +<title>Sample Application JSP Page</title> +</head> +<body bgcolor=white> + +<table border="0"> +<tr> +<td align=center> +<img src="images/tomcat.gif"> +</td> +<td> +<h1>Sample Application JSP Page</h1> +This is the output of a JSP page that is part of the Hello, World +application. +</td> +</tr> +</table> + +<%= new String("Hello!") %> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/images/tomcat.gif ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/images/tomcat.gif b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/images/tomcat.gif new file mode 100644 index 0000000..32f7d80 Binary files /dev/null and b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/images/tomcat.gif differ http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/index.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/index.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/index.html new file mode 100644 index 0000000..81bd063 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/sample/web/index.html @@ -0,0 +1,44 @@ +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<html> +<head> +<title>Sample "Hello, World" Application</title> +</head> +<body bgcolor=white> + +<table border="0"> +<tr> +<td> +<img src="images/tomcat.gif"> +</td> +<td> +<h1>Sample "Hello, World" Application</h1> +<p>This is the home page for a sample application used to illustrate the +source directory organization of a web application utilizing the principles +outlined in the Application Developer's Guide. +</td> +</tr> +</table> + +<p>To prove that they work, you can execute either of the following links: +<ul> +<li>To a <a href="hello.jsp">JSP page</a>. +<li>To a <a href="hello">servlet</a>. +</ul> + +</body> +</html> http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/source.html ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/source.html b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/source.html new file mode 100644 index 0000000..6407dc1 --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/source.html @@ -0,0 +1,287 @@ +<html><head><META http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Application Developer's Guide - Source Organization</title><meta content="Craig R. McClanahan" name="author"><style media="print" type="text/css"> + .noPrint {display: none;} + td#mainBody {width: 100%;} + </style></head><body vlink="#525D76" alink="#525D76" link="#525D76" text="#000000" bgcolor="#ffffff"><table cellspacing="0" width="100%" border="0"><!--PAGE HEADER--><tr><td><!--PROJECT LOGO--><a href="http://tomcat.apache.org/"><img border="0" alt=" + The Apache Tomcat Servlet/JSP Container + " align="right" src="../images/tomcat.gif"></a></td><td><h1><font face="arial,helvetica,sanserif">Apache Tomcat 6.0</font></h1></td><td><!--APACHE LOGO--><a href="http://www.apache.org/"><img border="0" alt="Apache Logo" align="right" src="../images/asf-logo.gif"></a></td></tr></table><table cellspacing="4" width="100%" border="0"><!--HEADER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><tr><!--LEFT SIDE NAVIGATION--><td class="noPrint" nowrap valign="top" width="20%"><p><strong>Links</strong></p><ul><li><a href="../index.html">Docs Home</a></li></ul><p><strong>Contents</strong></p><ul><li><a href="index.html">Contents</a></li><li><a href="introduction.html">Introduction</a></li><li><a href="installation.html">Installation</a></li><li><a href="deployment.html">Deployment</a></li><li><a href="source.html">Source Code</a></li><li><a href="processes.html">Processes</a></li><li><a href="sample/">Example App</a></li></ul></td><!--RIGHT SIDE MAIN BODY--><td id="mainBo dy" align="left" valign="top" width="80%"><h1>Application Developer's Guide</h1><h2>Source Organization</h2><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Table of Contents"><!--()--></a><a name="Table_of_Contents"><strong>Table of Contents</strong></a></font></td></tr><tr><td><blockquote> +<ul><li><a href="#Directory_Structure">Directory Structure</a><ol><li><a href="#External_Dependencies">External Dependencies</a></li></ol></li><li><a href="#Source_Code_Control">Source Code Control</a></li><li><a href="#BUILD.XML_Configuration_File">BUILD.XML Configuration File</a></li></ul> +</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Directory Structure"><!--()--></a><a name="Directory_Structure"><strong>Directory Structure</strong></a></font></td></tr><tr><td><blockquote> + + <blockquote><em> + <p>The description below uses the variable name $CATALINA_BASE to refer the + base directory against which most relative paths are resolved. If you have + not configured Tomcat 6 for multiple instances by setting a CATALINA_BASE + directory, then $CATALINA_BASE will be set to the value of $CATALINA_HOME, + the directory into which you have installed Tomcat 6.</p> + </em></blockquote> + +<p>A key recommendation of this manual is to separate the directory +hierarchy containing your source code (described in this section) from +the directory hierarchy containing your deployable application +(described in the preceding section). Maintaining this separation has +the following advantages:</p> +<ul> +<li>The contents of the source directories can be more easily administered, + moved, and backed up if the "executable" version of the application + is not intermixed. + <br><br></li> +<li>Source code control is easier to manage on directories that contain + only source files. + <br><br></li> +<li>The files that make up an installable distribution of your + application are much easier to select when the deployment + hierarchy is separate.</li> +</ul> + +<p>As we will see, the <code>ant</code> development tool makes the creation +and processing of such directory hierarchies nearly painless.</p> + +<p>The actual directory and file hierarchy used to contain the source code +of an application can be pretty much anything you like. However, the +following organization has proven to be quite generally applicable, and is +expected by the example <code>build.xml</code> configuration file that +is discussed below. All of these components exist under a top level +<em>project source directory</em> for your application:</p> +<ul> +<li><strong>docs/</strong> - Documentation for your application, in whatever + format your development team is using.<br><br></li> +<li><strong>src/</strong> - Java source files that generate the servlets, + beans, and other Java classes that are unique to your application. + If your source code is organized in packages (<strong>highly</strong> + recommended), the package hierarchy should be reflected as a directory + structure underneath this directory.<br><br></li> +<li><strong>web/</strong> - The static content of your web site (HTML pages, + JSP pages, JavaScript files, CSS stylesheet files, and images) that will + be accessible to application clients. This directory will be the + <em>document root</em> of your web application, and any subdirectory + structure found here will be reflected in the request URIs required to + access those files.<br><br></li> +<li><strong>web/WEB-INF/</strong> - The special configuration files required + for your application, including the web application deployment descriptor + (<code>web.xml</code>, defined in the + <a href="http://java.sun.com/products/servlet">Servlet Specification</a>), + tag library descriptors for custom tag libraries + you have created, and other resource files you wish to include within + your web application. Even though this directory appears to be a + subdirectory of your <em>document root</em>, the Servlet Specification + prohibits serving the contents of this directory (or any file it contains) + directly to a client request. Therefore, this is a good place to store + configuration information that is sensitive (such as database connection + usernames and passwords), but is required for your application to + operate successfully.</li> +</ul> + +<p>During the development process, two additional directories will be +created on a temporary basis:</p> +<ul> +<li><strong>build/</strong> - When you execute a default build + (<code>ant</code>), this directory will contain an exact image + of the files in the web application archive for this application. + Tomcat 6 allows you to deploy an application in an unpacked + directory like this, either by copying it to the + <code>$CATALINA_BASE/webapps</code> directory, or by <em>installing</em> + it via the "Manager" web application. The latter approach is very + useful during development, and will be illustrated below. + <br><br></li> +<li><strong>dist/</strong> - When you execute the <code>ant dist</code> + target, this directory will be created. It will create an exact image + of the binary distribution for your web application, including an license + information, documentation, and README files that you have prepared.</li> +</ul> + +<p>Note that these two directories should <strong>NOT</strong> be archived in +your source code control system, because they are deleted and recreated (from +scratch) as needed during development. For that reason, you should not edit +any source files in these directories if you want to maintain a permanent +record of the changes, because the changes will be lost the next time that a +build is performed.</p> + + <table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#828DA6"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="External Dependencies"><!--()--></a><a name="External_Dependencies"><strong>External Dependencies</strong></a></font></td></tr><tr><td><blockquote> + + <p>What do you do if your application requires JAR files (or other + resources) from external projects or packages? A common example is that + you need to include a JDBC driver in your web application, in order to + operate.</p> + + <p>Different developers take different approaches to this problem. + Some will encourage checking a copy of the JAR files you depend on into + the source code control archives for every application that requires those + JAR files. However, this can cause significant management issues when you + use the same JAR in many applications - particular when faced with a need + to upgrade to a different version of that JAR file.</p> + + <p>Therefore, this manual recommends that you <strong>NOT</strong> store + a copy of the packages you depend on inside the source control archives + of your applications. Instead, the external dependencies should be + integrated as part of the process of <strong>building</strong> your + application. In that way, you can always pick up the appropriate version + of the JAR files from wherever your development system administrator has + installed them, without having to worry about updating your application + every time the version of the dependent JAR file is changed.</p> + + <p>In the example Ant <code>build.xml</code> file, we will demonstrate + how to define <em>build properties</em> that let you configure the locations + of the files to be copied, without having to modify <code>build.xml</code> + when these files change. The build properties used by a particular + developer can be customized on a per-application basis, or defaulted to + "standard" build properties stored in the developer's home directory.</p> + + <p>In many cases, your development system administrator will have already + installed the required JAR files into the <code>lib</code> directory of Tomcat. + If this has been done, you need + to take no actions at all - the example <code>build.xml</code> file + automatically constructs a compile classpath that includes these files.</p> + + </blockquote></td></tr></table> + +</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="Source Code Control"><!--()--></a><a name="Source_Code_Control"><strong>Source Code Control</strong></a></font></td></tr><tr><td><blockquote> + +<p>As mentioned earlier, it is highly recommended that you place all of the +source files that comprise your application under the management of a +source code control system like the Concurrent Version System (CVS). If you +elect to do this, every directory and file in the source hierarchy should be +registered and saved -- but none of the generated files. If you register +binary format files (such as images or JAR libraries), be sure to indicate +this to your source code control system.</p> + +<p>We recommended (in the previous section) that you should not store the +contents of the <code>build/</code> and <code>dist/</code> directories +created by your development process in the source code control system. An +easy way to tell CVS to ignore these directories is to create a file named +<code>.cvsignore</code> (note the leading period) in your top-level source +directory, with the following contents:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +build +dist +build.properties +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>The reason for mentioning <code>build.properties</code> here will be +explained in the <a href="processes.html">Processes</a> section.</p> + +<p>Detailed instructions for your source code control environment are beyond +the scope of this manual. However, the following steps are followed when +using a command-line CVS client:</p> +<ul> +<li>To refresh the state of your source code to that stored in the + the source repository, go to your project source directory, and + execute <code>cvs update -dP</code>. + <br><br></li> +<li>When you create a new subdirectory in the source code hierarchy, register + it in CVS with a command like <code>cvs add {subdirname}</code>. + <br><br></li> +<li>When you first create a new source code file, navigate to the directory + that contains it, and register the new file with a command like + <code>cvs add {filename}</code>. + <br><br></li> +<li>If you no longer need a particular source code file, navigate to the + containing directory and remove the file. Then, deregister it in CVS + with a command like <code>cvs remove {filename}</code>. + <br><br></li> +<li>While you are creating, modifying, and deleting source files, changes + are not yet reflected in the server repository. To save your changes in + their current state, go to the project source directory + and execute <code>cvs commit</code>. You will be asked to write a brief + description of the changes you have just completed, which will be stored + with the new version of any updated source file.</li> +</ul> + +<p>CVS, like other source code control systems, has many additional features +(such as the ability to tag the files that made up a particular release, and +support for multiple development branches that can later be merged). See the +links and references in the <a href="introduction.html">Introduction</a> for +more information.</p> + +</blockquote></td></tr></table><table cellpadding="2" cellspacing="0" border="0"><tr><td bgcolor="#525D76"><font face="arial,helvetica.sanserif" color="#ffffff"><a name="BUILD.XML Configuration File"><!--()--></a><a name="BUILD.XML_Configuration_File"><strong>BUILD.XML Configuration File</strong></a></font></td></tr><tr><td><blockquote> + +<p>We will be using the <strong>ant</strong> tool to manage the compilation of +our Java source code files, and creation of the deployment hierarchy. Ant +operates under the control of a build file, normally called +<code>build.xml</code>, that defines the processing steps required. This +file is stored in the top-level directory of your source code hierarchy, and +should be checked in to your source code control system.</p> + +<p>Like a Makefile, the <code>build.xml</code> file provides several +"targets" that support optional development activities (such as creating +the associated Javadoc documentation, erasing the deployment home directory +so you can build your project from scratch, or creating the web application +archive file so you can distribute your application. A well-constructed +<code>build.xml</code> file will contain internal documentation describing +the targets that are designed for use by the developer, versus those targets +used internally. To ask Ant to display the project documentation, change to +the directory containing the <code>build.xml</code> file and type:</p> +<div align="left"><table border="0" cellpadding="0" cellspacing="4"><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#ffffff"><pre> +ant -projecthelp +</pre></td><td width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr><tr><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td><td height="1" width="1" bgcolor="#023264"><img border="0" hspace="0" vspace="0" height="1" width="1" alt="" src="../images/void.gif"></td></tr></table></div> + +<p>To give you a head start, a <a href="build.xml.txt">basic build.xml file</a> +is provided that you can customize and install in the project source directory +for your application. This file includes comments that describe the various +targets that can be executed. Briefly, the following targets are generally +provided:</p> +<ul> +<li><strong>clean</strong> - This target deletes any existing + <code>build</code> and <code>dist</code> directories, so that they + can be reconstructed from scratch. This allows you to guarantee that + you have not made source code modifications that will result in + problems at runtime due to not recompiling all affected classes. + <br><br></li> +<li><strong>compile</strong> - This target is used to compile any source code + that has been changed since the last time compilation took place. The + resulting class files are created in the <code>WEB-INF/classes</code> + subdirectory of your <code>build</code> directory, exactly where the + structure of a web application requires them to be. Because + this command is executed so often during development, it is normally + made the "default" target so that a simple <code>ant</code> command will + execute it. + <br><br></li> +<li><strong>all</strong> - This target is a short cut for running the + <code>clean</code> target, followed by the <code>compile</code> target. + Thus, it guarantees that you will recompile the entire application, to + ensure that you have not unknowingly introduced any incompatible changes. + <br><br></li> +<li><strong>javadoc</strong> - This target creates Javadoc API documentation + for the Java classes in this web application. The example + <code>build.xml</code> file assumes you want to include the API + documentation with your app distribution, so it generates the docs + in a subdirectory of the <code>dist</code> directory. Because you normally + do not need to generate the Javadocs on every compilation, this target is + usually a dependency of the <code>dist</code> target, but not of the + <code>compile</code> target. + <br><br></li> +<li><strong>dist</strong> - This target creates a distribution directory for + your application, including any required documentation, the Javadocs for + your Java classes, and a web application archive (WAR) file that will be + delivered to system administrators who wish to install your application. + Because this target also depends on the <code>deploy</code> target, the + web application archive will have also picked up any external dependencies + that were included at deployment time.</li> +</ul> + +<p>For interactive development and testing of your web application using +Tomcat 6, the following additional targets are defined:</p> +<ul> +<li><strong>install</strong> - Tell the currently running Tomcat 6 to make + the application you are developing immediately available for execution + and testing. This action does not require Tomcat 6 to be restarted, but + it is also not remembered after Tomcat is restarted the next time. + <br><br></li> +<li><strong>reload</strong> - Once the application is installed, you can + continue to make changes and recompile using the <code>compile</code> + target. Tomcat 6 will automatically recognize changes made to JSP pages, + but not to servlet or JavaBean classes - this command will tell Tomcat + to restart the currently installed application so that such changes are + recognized. + <br><br></li> +<li><strong>remove</strong> - When you have completed your development and + testing activities, you can optionally tell Tomcat 6 to remove this + application from service. + </li> +</ul> + +<p>Using the development and testing targets requires some additional +one-time setup that is described on the next page.</p> + +</blockquote></td></tr></table></td></tr><!--FOOTER SEPARATOR--><tr><td colspan="2"><hr size="1" noshade></td></tr><!--PAGE FOOTER--><tr><td colspan="2"><div align="center"><font size="-1" color="#525D76"><em> + Copyright © 1999-2010, Apache Software Foundation + </em></font></div></td></tr></table></body></html> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-blazeds/blob/5be16a28/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/web.xml.txt ---------------------------------------------------------------------- diff --git a/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/web.xml.txt b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/web.xml.txt new file mode 100644 index 0000000..b54c61a --- /dev/null +++ b/attic/servers/apache-tomcat-6.0.29/webapps/docs/appdev/web.xml.txt @@ -0,0 +1,166 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<!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> + + + <!-- General description of your web application --> + + <display-name>My Web Application</display-name> + <description> + This is version X.X of an application to perform + a wild and wonderful task, based on servlets and + JSP pages. It was written by Dave Developer + ([email protected]), who should be contacted for + more information. + </description> + + + <!-- Context initialization parameters that define shared + String constants used within your application, which + can be customized by the system administrator who is + installing your application. The values actually + assigned to these parameters can be retrieved in a + servlet or JSP page by calling: + + String value = + getServletContext().getInitParameter("name"); + + where "name" matches the <param-name> element of + one of these initialization parameters. + + You can define any number of context initialization + parameters, including zero. + --> + + <context-param> + <param-name>webmaster</param-name> + <param-value>[email protected]</param-value> + <description> + The EMAIL address of the administrator to whom questions + and comments about this application should be addressed. + </description> + </context-param> + + + <!-- Servlet definitions for the servlets that make up + your web application, including initialization + parameters. With Tomcat, you can also send requests + to servlets not listed here with a request like this: + + http://localhost:8080/{context-path}/servlet/{classname} + + but this usage is not guaranteed to be portable. It also + makes relative references to images and other resources + required by your servlet more complicated, so defining + all of your servlets (and defining a mapping to them with + a servlet-mapping element) is recommended. + + Servlet initialization parameters can be retrieved in a + servlet or JSP page by calling: + + String value = + getServletConfig().getInitParameter("name"); + + where "name" matches the <param-name> element of + one of these initialization parameters. + + You can define any number of servlets, including zero. + --> + + <servlet> + <servlet-name>controller</servlet-name> + <description> + This servlet plays the "controller" role in the MVC architecture + used in this application. It is generally mapped to the ".do" + filename extension with a servlet-mapping element, and all form + submits in the app will be submitted to a request URI like + "saveCustomer.do", which will therefore be mapped to this servlet. + + The initialization parameter names for this servlet are the + "servlet path" that will be received by this servlet (after the + filename extension is removed). The corresponding value is the + name of the action class that will be used to process this request. + </description> + <servlet-class>com.mycompany.mypackage.ControllerServlet</servlet-class> + <init-param> + <param-name>listOrders</param-name> + <param-value>com.mycompany.myactions.ListOrdersAction</param-value> + </init-param> + <init-param> + <param-name>saveCustomer</param-name> + <param-value>com.mycompany.myactions.SaveCustomerAction</param-value> + </init-param> + <!-- Load this servlet at server startup time --> + <load-on-startup>5</load-on-startup> + </servlet> + + <servlet> + <servlet-name>graph</servlet-name> + <description> + This servlet produces GIF images that are dynamically generated + graphs, based on the input parameters included on the request. + It is generally mapped to a specific request URI like "/graph". + </description> + </servlet> + + + <!-- Define mappings that are used by the servlet container to + translate a particular request URI (context-relative) to a + particular servlet. The examples below correspond to the + servlet descriptions above. Thus, a request URI like: + + http://localhost:8080/{contextpath}/graph + + will be mapped to the "graph" servlet, while a request like: + + http://localhost:8080/{contextpath}/saveCustomer.do + + will be mapped to the "controller" servlet. + + You may define any number of servlet mappings, including zero. + It is also legal to define more than one mapping for the same + servlet, if you wish to. + --> + + <servlet-mapping> + <servlet-name>controller</servlet-name> + <url-pattern>*.do</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>graph</servlet-name> + <url-pattern>/graph</url-pattern> + </servlet-mapping> + + + <!-- Define the default session timeout for your application, + in minutes. From a servlet or JSP page, you can modify + the timeout for a particular session dynamically by using + HttpSession.getMaxInactiveInterval(). --> + + <session-config> + <session-timeout>30</session-timeout> <!-- 30 minutes --> + </session-config> + + +</web-app>
