You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/08/29 11:02:41 UTC

svn commit: r1518540 [2/3] - in /tomcat/trunk: modules/jdbc-pool/doc/ webapps/docs/

Modified: tomcat/trunk/webapps/docs/jasper-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jasper-howto.xml?rev=1518540&r1=1518539&r2=1518540&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/jasper-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jasper-howto.xml Thu Aug 29 09:02:41 2013
@@ -42,7 +42,7 @@ specification.</p>
 
 <p>Jasper 2 has been redesigned to significantly improve performance over
 the original Jasper.  In addition to general code improvements the following
-changes were made:
+changes were made:</p>
 <ul>
 <li><strong>JSP Custom Tag Pooling</strong> - The java objects instantiated
 for JSP Custom Tags can now be pooled and reused.  This significantly boosts
@@ -61,7 +61,7 @@ Eclipse JDT Java compiler is now used to
 compilation. This compiler loads source dependencies from the container
 classloader. Ant and javac can still be used.</li>
 </ul>
-</p>
+
 
 <p>Jasper is implemented using the servlet class
 <code>org.apache.jasper.servlet.JspServlet</code>.</p>
@@ -71,13 +71,13 @@ classloader. Ant and javac can still be 
 <section name="Configuration">
 
 <p>By default Jasper is configured for use when doing web application
-development.  See the section <a href="#Production Configuration">
+development.  See the section <a href="#Production_Configuration">
 Production Configuration</a> for information on configuring Jasper
 for use on a production Tomcat server.</p>
 
 <p>The servlet which implements Jasper is configured using init parameters
 in your global <code>$CATALINA_BASE/conf/web.xml</code>.
-
+</p>
 <ul>
 <li><strong>checkInterval</strong> - If development is false and checkInterval
 is greater than zero, background compiles are enabled. checkInterval is the time
@@ -198,7 +198,7 @@ actions or directives be trimmed ?, defa
 header is added by generated servlet. <code>true</code> or <code>false</code>,
 default <code>false</code>.</li>
 </ul>
-</p>
+
 
 <p>The Java compiler from Eclipse JDT in included as the default compiler. It is
 an advanced Java compiler which will load all dependencies from the Tomcat class
@@ -222,12 +222,12 @@ bug 6294277</a>, may cause a
 <code>java.lang.InternalError: name is too long to represent</code> exception
 when compiling very large JSPs. If this is observed then it may be worked around
 by using one of the following:
+</p>
 <ul>
 <li>reduce the size of the JSP</li>
 <li>disable SMAP generation and JSR-045 support by setting
 <code>suppressSmap</code> to <code>true</code>.</li>
 </ul>
-</p>
 
 </section>
 
@@ -239,7 +239,7 @@ jsp-property-group feature) or practical
 Jasper servlet becomes critical.</p>
 
 <p>When using Jasper 2 in a production Tomcat server you should consider making
-the following changes from the default configuration.
+the following changes from the default configuration.</p>
 <ul>
 <li><strong>development</strong> - To disable on access checks for JSP
 pages compilation set this to <code>false</code>.</li>
@@ -251,7 +251,6 @@ this to a high value will improve perfor
 <li><strong>trimSpaces</strong> - To remove useless bytes from the response,
 set this to <code>true</code>.</li>
 </ul>
-</p>
 
 </section>
 
@@ -264,73 +263,68 @@ Use the script given below (a similar sc
 download) to precompile a webapp:
 </p>
 
-<p>
-<source>
-&lt;project name="Webapp Precompilation" default="all" basedir="."&gt;
+<source><![CDATA[<project name="Webapp Precompilation" default="all" basedir=".">
 
-   &lt;import file="${tomcat.home}/bin/catalina-tasks.xml"/&gt;
+   <import file="${tomcat.home}/bin/catalina-tasks.xml"/>
 
-   &lt;target name="jspc"&gt;
+   <target name="jspc">
 
-    &lt;jasper
+    <jasper
              validateXml="false"
              uriroot="${webapp.path}"
              webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
-             outputDir="${webapp.path}/WEB-INF/src" /&gt;
+             outputDir="${webapp.path}/WEB-INF/src" />
 
-  &lt;/target&gt;
+  </target>
 
-  &lt;target name="compile"&gt;
+  <target name="compile">
 
-    &lt;mkdir dir="${webapp.path}/WEB-INF/classes"/&gt;
-    &lt;mkdir dir="${webapp.path}/WEB-INF/lib"/&gt;
+    <mkdir dir="${webapp.path}/WEB-INF/classes"/>
+    <mkdir dir="${webapp.path}/WEB-INF/lib"/>
 
-    &lt;javac destdir="${webapp.path}/WEB-INF/classes"
+    <javac destdir="${webapp.path}/WEB-INF/classes"
            optimize="off"
            debug="on" failonerror="false"
            srcdir="${webapp.path}/WEB-INF/src"
-           excludes="**/*.smap"&gt;
-      &lt;classpath&gt;
-        &lt;pathelement location="${webapp.path}/WEB-INF/classes"/&gt;
-        &lt;fileset dir="${webapp.path}/WEB-INF/lib"&gt;
-          &lt;include name="*.jar"/&gt;
-        &lt;/fileset&gt;
-        &lt;pathelement location="${tomcat.home}/lib"/&gt;
-        &lt;fileset dir="${tomcat.home}/lib"&gt;
-          &lt;include name="*.jar"/&gt;
-        &lt;/fileset&gt;
-        &lt;fileset dir="${tomcat.home}/bin"&gt;
-          &lt;include name="*.jar"/&gt;
-        &lt;/fileset&gt;
-      &lt;/classpath&gt;
-      &lt;include name="**" /&gt;
-      &lt;exclude name="tags/**" /&gt;
-    &lt;/javac&gt;
-
-  &lt;/target&gt;
-
-  &lt;target name="all" depends="jspc,compile"&gt;
-  &lt;/target&gt;
-
-  &lt;target name="cleanup"&gt;
-    &lt;delete&gt;
-        &lt;fileset dir="${webapp.path}/WEB-INF/src"/&gt;
-        &lt;fileset dir="${webapp.path}/WEB-INF/classes/org/apache/jsp"/&gt;
-    &lt;/delete&gt;
-  &lt;/target&gt;
+           excludes="**/*.smap">
+      <classpath>
+        <pathelement location="${webapp.path}/WEB-INF/classes"/>
+        <fileset dir="${webapp.path}/WEB-INF/lib">
+          <include name="*.jar"/>
+        </fileset>
+        <pathelement location="${tomcat.home}/lib"/>
+        <fileset dir="${tomcat.home}/lib">
+          <include name="*.jar"/>
+        </fileset>
+        <fileset dir="${tomcat.home}/bin">
+          <include name="*.jar"/>
+        </fileset>
+      </classpath>
+      <include name="**" />
+      <exclude name="tags/**" />
+    </javac>
+
+  </target>
+
+  <target name="all" depends="jspc,compile">
+  </target>
+
+  <target name="cleanup">
+    <delete>
+        <fileset dir="${webapp.path}/WEB-INF/src"/>
+        <fileset dir="${webapp.path}/WEB-INF/classes/org/apache/jsp"/>
+    </delete>
+  </target>
 
-&lt;/project&gt;
-</source>
-</p>
+</project>]]></source>
 
 <p>
 The following command line can be used to run the script
 (replacing the tokens with the Tomcat base path and the path to the webapp
-which should be precompiled):<br/>
-<source>
-$ANT_HOME/bin/ant -Dtomcat.home=&lt;$TOMCAT_HOME&gt; -Dwebapp.path=&lt;$WEBAPP_PATH&gt;
-</source>
+which should be precompiled):
 </p>
+<source>$ANT_HOME/bin/ant -Dtomcat.home=&lt;$TOMCAT_HOME&gt; -Dwebapp.path=&lt;$WEBAPP_PATH&gt;</source>
+
 
 <p>
 Then, the declarations and mappings for the servlets which were generated
@@ -366,7 +360,7 @@ and the compile jsp servlet classes at
 <code>${webapp.path}/WEB-INF/classes/org/apache/jsp</code>.
 </p>
 
-<p><strong>Hints:</strong>
+<p><strong>Hints:</strong></p>
 <ul>
 <li> When you switch to another Tomcat release, then regenerate and recompile
 your jsp's with the new Tomcat version.</li>
@@ -377,7 +371,6 @@ and limit the buffering with
 that changing from the defaults may affect performance, but it will vary
 depending on the application.</li>
 </ul>
-</p>
 </section>
 
 <section name="Optimisation">

Modified: tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml?rev=1518540&r1=1518539&r2=1518540&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jndi-datasource-examples-howto.xml Thu Aug 29 09:02:41 2013
@@ -196,7 +196,7 @@ The default is <code>false</code>.
 
 <subsection name="MySQL DBCP Example">
 
-<h3>0. Introduction</h3>
+<h5>0. Introduction</h5>
 <p>Versions of <a href="http://www.mysql.com/products/mysql/index.html">MySQL</a> and JDBC
 drivers that have been reported to work:
 </p>
@@ -208,7 +208,7 @@ drivers that have been reported to work:
 
 <p>Before you proceed, don't forget to copy the JDBC Driver's jar into <code>$CATALINA_HOME/lib</code>.</p>
 
-<h3>1. MySQL configuration</h3>
+<h5>1. MySQL configuration</h5>
 <p>
 Ensure that you follow these instructions as variations can cause problems.
 </p>
@@ -217,16 +217,14 @@ Ensure that you follow these instruction
 Your MySQL user <strong>must</strong> have a password assigned. The driver
 will fail if you try to connect with an empty password.
 </p>
-<source>
-mysql&gt; GRANT ALL PRIVILEGES ON *.* TO javauser@localhost
-    -&gt;   IDENTIFIED BY 'javadude' WITH GRANT OPTION;
-mysql&gt; create database javatest;
-mysql&gt; use javatest;
-mysql&gt; create table testdata (
-    -&gt;   id int not null auto_increment primary key,
-    -&gt;   foo varchar(25),
-    -&gt;   bar int);
-</source>
+<source><![CDATA[mysql> GRANT ALL PRIVILEGES ON *.* TO javauser@localhost
+    ->   IDENTIFIED BY 'javadude' WITH GRANT OPTION;
+mysql> create database javatest;
+mysql> use javatest;
+mysql> create table testdata (
+    ->   id int not null auto_increment primary key,
+    ->   foo varchar(25),
+    ->   bar int);]]></source>
 <blockquote>
 <strong>Note:</strong> the above user should be removed once testing is
 complete!
@@ -234,8 +232,7 @@ complete!
 
 <p>Next insert some test data into the testdata table.
 </p>
-<source>
-mysql&gt; insert into testdata values(null, 'hello', 12345);
+<source><![CDATA[mysql> insert into testdata values(null, 'hello', 12345);
 Query OK, 1 row affected (0.00 sec)
 
 mysql> select * from testdata;
@@ -246,95 +243,87 @@ mysql> select * from testdata;
 +----+-------+-------+
 1 row in set (0.00 sec)
 
-mysql&gt;
-</source>
+mysql>]]></source>
 
-<h3>2. Context configuration</h3>
+<h5>2. Context configuration</h5>
 <p>Configure the JNDI DataSource in Tomcat by adding a declaration for your
 resource to your <a href="config/context.html">Context</a>.</p>
 <p>For example:</p>
-<source>
-&lt;Context&gt;
+<source><![CDATA[<Context>
 
-    &lt;!-- maxActive: Maximum number of database connections in pool. Make sure you
+    <!-- maxActive: Maximum number of database connections in pool. Make sure you
          configure your mysqld max_connections large enough to handle
          all of your db connections. Set to -1 for no limit.
-         --&gt;
+         -->
 
-    &lt;!-- maxIdle: Maximum number of idle database connections to retain in pool.
+    <!-- maxIdle: Maximum number of idle database connections to retain in pool.
          Set to -1 for no limit.  See also the DBCP documentation on this
          and the minEvictableIdleTimeMillis configuration parameter.
-         --&gt;
+         -->
 
-    &lt;!-- maxWait: Maximum time to wait for a database connection to become available
+    <!-- maxWait: Maximum time to wait for a database connection to become available
          in ms, in this example 10 seconds. An Exception is thrown if
          this timeout is exceeded.  Set to -1 to wait indefinitely.
-         --&gt;
+         -->
 
-    &lt;!-- username and password: MySQL username and password for database connections  --&gt;
+    <!-- username and password: MySQL username and password for database connections  -->
 
-    &lt;!-- driverClassName: Class name for the old mm.mysql JDBC driver is
+    <!-- driverClassName: Class name for the old mm.mysql JDBC driver is
          org.gjt.mm.mysql.Driver - we recommend using Connector/J though.
          Class name for the official MySQL Connector/J driver is com.mysql.jdbc.Driver.
-         --&gt;
+         -->
 
-    &lt;!-- url: The JDBC connection url for connecting to your MySQL database.
-         --&gt;
+    <!-- url: The JDBC connection url for connecting to your MySQL database.
+         -->
 
-  &lt;Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
+  <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
                maxActive="100" maxIdle="30" maxWait="10000"
                username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
-               url="jdbc:mysql://localhost:3306/javatest"/&gt;
+               url="jdbc:mysql://localhost:3306/javatest"/>
 
-&lt;/Context&gt;
-</source>
+</Context>]]></source>
 
-<h3>3. web.xml configuration</h3>
+<h5>3. web.xml configuration</h5>
 
 <p>Now create a <code>WEB-INF/web.xml</code> for this test application.</p>
-<source>
-&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+<source><![CDATA[<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"&gt;
-  &lt;description&gt;MySQL Test App&lt;/description&gt;
-  &lt;resource-ref&gt;
-      &lt;description&gt;DB Connection&lt;/description&gt;
-      &lt;res-ref-name&gt;jdbc/TestDB&lt;/res-ref-name&gt;
-      &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
-      &lt;res-auth&gt;Container&lt;/res-auth&gt;
-  &lt;/resource-ref&gt;
-&lt;/web-app&gt;
-</source>
-
-<h3>4. Test code</h3>
-<p>Now create a simple <code>test.jsp</code> page for use later.
-<source>
-&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %&gt;
-&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
+    version="2.4">
+  <description>MySQL Test App</description>
+  <resource-ref>
+      <description>DB Connection</description>
+      <res-ref-name>jdbc/TestDB</res-ref-name>
+      <res-type>javax.sql.DataSource</res-type>
+      <res-auth>Container</res-auth>
+  </resource-ref>
+</web-app>]]></source>
+
+<h5>4. Test code</h5>
+<p>Now create a simple <code>test.jsp</code> page for use later.</p>
+<source><![CDATA[<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 
-&lt;sql:query var="rs" dataSource="jdbc/TestDB"&gt;
+<sql:query var="rs" dataSource="jdbc/TestDB">
 select id, foo, bar from testdata
-&lt;/sql:query&gt;
+</sql:query>
 
-&lt;html&gt;
-  &lt;head&gt;
-    &lt;title&gt;DB Test&lt;/title&gt;
-  &lt;/head&gt;
-  &lt;body&gt;
-
-  &lt;h2&gt;Results&lt;/h2&gt;
-
-&lt;c:forEach var="row" items="${rs.rows}"&gt;
-    Foo ${row.foo}&lt;br/&gt;
-    Bar ${row.bar}&lt;br/&gt;
-&lt;/c:forEach&gt;
-
-  &lt;/body&gt;
-&lt;/html&gt;
-</source>
-</p>
+<html>
+  <head>
+    <title>DB Test</title>
+  </head>
+  <body>
+
+  <h2>Results</h2>
+
+<c:forEach var="row" items="${rs.rows}">
+    Foo ${row.foo}<br/>
+    Bar ${row.bar}<br/>
+</c:forEach>
+
+  </body>
+</html>]]></source>
 
 <p>That JSP page makes use of <a href="http://java.sun.com/products/jsp/jstl">JSTL</a>'s
 SQL and Core taglibs. You can get it from
@@ -355,7 +344,7 @@ your hard work.</p>
 </subsection>
 
 <subsection name="Oracle 8i, 9i &amp; 10g">
-<h3>0.    Introduction</h3>
+<h5>0.    Introduction</h5>
 
 <p>Oracle requires minimal changes from the MySQL configuration except for the
 usual gotchas :-)</p>
@@ -372,7 +361,7 @@ that <code>oracle.jdbc.driver.OracleDriv
 for this driver class will be discontinued in the next major release.
 </p>
 
-<h3>1. Context configuration</h3>
+<h5>1. Context configuration</h5>
 <p>In a similar manner to the mysql config above, you will need to define your
 Datasource in your <a href="config/context.html">Context</a>. Here we define a
 Datasource called myoracle using the thin driver to connect as user scott,
@@ -382,57 +371,51 @@ user scott.</p>
 
 <p>Use of the OCI driver should simply involve a changing thin to oci in the URL string.
 </p>
-<source>
-&lt;Resource name="jdbc/myoracle" auth="Container"
+<source><![CDATA[<Resource name="jdbc/myoracle" auth="Container"
               type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver"
               url="jdbc:oracle:thin:@127.0.0.1:1521:mysid"
               username="scott" password="tiger" maxActive="20" maxIdle="10"
-              maxWait="-1"/&gt;
-</source>
+              maxWait="-1"/>]]></source>
 
-<h3>2.    web.xml configuration</h3>
+<h5>2.    web.xml configuration</h5>
 <p>You should ensure that you respect the element ordering defined by the DTD when you
 create you applications web.xml file.</p>
-<source>
-&lt;resource-ref&gt;
- &lt;description&gt;Oracle Datasource example&lt;/description&gt;
- &lt;res-ref-name&gt;jdbc/myoracle&lt;/res-ref-name&gt;
- &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
- &lt;res-auth&gt;Container&lt;/res-auth&gt;
-&lt;/resource-ref&gt;
-</source>
-<h3>3.   Code example</h3>
+<source><![CDATA[<resource-ref>
+ <description>Oracle Datasource example</description>
+ <res-ref-name>jdbc/myoracle</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+</resource-ref>]]></source>
+<h5>3.   Code example</h5>
 <p>You can use the same example application as above (asuming you create the required DB
 instance, tables etc.) replacing the Datasource code with something like</p>
-<source>
-Context initContext = new InitialContext();
+<source><![CDATA[Context initContext = new InitialContext();
 Context envContext  = (Context)initContext.lookup("java:/comp/env");
 DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
 Connection conn = ds.getConnection();
-//etc.
-</source>
+//etc.]]></source>
 </subsection>
 
 
 <subsection name="PostgreSQL">
-<h3>0.    Introduction</h3>
+<h5>0.    Introduction</h5>
 <p>PostgreSQL is configured in a similar manner to Oracle.</p>
 
-<h3>1. Required files </h3>
+<h5>1. Required files </h5>
 <p>
 Copy the Postgres JDBC jar to $CATALINA_HOME/lib. As with Oracle, the
 jars need to be in this directory in order for DBCP's Classloader to find
 them. This has to be done regardless of which configuration step you take next.
 </p>
 
-<h3>2. Resource configuration</h3>
+<h5>2. Resource configuration</h5>
 
 <p>
 You have two choices here: define a datasource that is shared across all Tomcat
 applications, or define a datasource specifically for one application.
 </p>
 
-<h4>2a. Shared resource configuration</h4>
+<h6>2a. Shared resource configuration</h6>
 <p>
 Use this option if you wish to define a datasource that is shared across
 multiple Tomcat applications, or if you just prefer defining your datasource
@@ -441,13 +424,11 @@ in this file.
 <p><i>This author has not had success here, although others have reported so.
 Clarification would be appreciated here.</i></p>
 
-<source>
-&lt;Resource name="jdbc/postgres" auth="Container"
+<source><![CDATA[<Resource name="jdbc/postgres" auth="Container"
           type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
           url="jdbc:postgresql://127.0.0.1:5432/mydb"
-          username="myuser" password="mypasswd" maxActive="20" maxIdle="10" maxWait="-1"/&gt;
-</source>
-<h4>2b. Application-specific resource configuration</h4>
+          username="myuser" password="mypasswd" maxActive="20" maxIdle="10" maxWait="-1"/>]]></source>
+<h6>2b. Application-specific resource configuration</h6>
 
 <p>
 Use this option if you wish to define a datasource specific to your application,
@@ -460,28 +441,24 @@ Create a resource definition for your <a
 The Context element should look something like the following.
 </p>
 
-<source>
-&lt;Context&gt;
+<source><![CDATA[<Context>
 
-&lt;Resource name="jdbc/postgres" auth="Container"
+<Resource name="jdbc/postgres" auth="Container"
           type="javax.sql.DataSource" driverClassName="org.postgresql.Driver"
           url="jdbc:postgresql://127.0.0.1:5432/mydb"
           username="myuser" password="mypasswd" maxActive="20" maxIdle="10"
-maxWait="-1"/&gt;
-&lt;/Context&gt;
-</source>
-
-<h3>3. web.xml configuration</h3>
-<source>
-&lt;resource-ref&gt;
- &lt;description&gt;postgreSQL Datasource example&lt;/description&gt;
- &lt;res-ref-name&gt;jdbc/postgres&lt;/res-ref-name&gt;
- &lt;res-type&gt;javax.sql.DataSource&lt;/res-type&gt;
- &lt;res-auth&gt;Container&lt;/res-auth&gt;
-&lt;/resource-ref&gt;
-</source>
+maxWait="-1"/>
+</Context>]]></source>
 
-<h4>4. Accessing the datasource</h4>
+<h5>3. web.xml configuration</h5>
+<source><![CDATA[<resource-ref>
+ <description>postgreSQL Datasource example</description>
+ <res-ref-name>jdbc/postgres</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+</resource-ref>]]></source>
+
+<h5>4. Accessing the datasource</h5>
 <p>
 When accessing the datasource programmatically, remember to prepend
 <code>java:/comp/env</code> to your JNDI lookup, as in the following snippet of
@@ -489,8 +466,7 @@ code. Note also that "jdbc/postgres" can
 you change it in the above resource definition file as well.
 </p>
 
-<source>
-InitialContext cxt = new InitialContext();
+<source><![CDATA[InitialContext cxt = new InitialContext();
 if ( cxt == null ) {
    throw new Exception("Uh oh -- no context!");
 }
@@ -499,8 +475,7 @@ DataSource ds = (DataSource) cxt.lookup(
 
 if ( ds == null ) {
    throw new Exception("Data source not found!");
-}
-</source>
+}]]></source>
 
 </subsection>
 </section>
@@ -539,12 +514,10 @@ using <code>System.loadLibrary("ocijdbc8
 You should next create a simple test servlet or jsp that has these
 <strong>critical lines</strong>:
 </p>
-<source>
-DriverManager.registerDriver(new
+<source><![CDATA[DriverManager.registerDriver(new
 oracle.jdbc.driver.OracleDriver());
 conn =
-DriverManager.getConnection("jdbc:oracle:oci8:@database","username","password");
-</source>
+DriverManager.getConnection("jdbc:oracle:oci8:@database","username","password");]]></source>
 <p>
 where database is of the form <code>host:port:SID</code> Now if you try to access the URL of your
 test servlet/jsp and what you get is a
@@ -552,6 +525,7 @@ test servlet/jsp and what you get is a
 </p>
 <p>
 First, the <code>UnsatisfiedLinkError</code> indicates that you have
+</p>
 <ul>
 <li>a mismatch between your JDBC classes file and
 your Oracle client version. The giveaway here is the message stating that a needed library file cannot be
@@ -563,7 +537,6 @@ Oracle client. The classeXXXs.zip file a
 the classes12.zip file from the directory <code>$ORAHOME\jdbc\lib</code> will also work.
 </li>
 </ul>
-</p>
 <p>
 Next you may experience the error <code>ORA-06401 NETCMN: invalid driver designator</code>
 </p>
@@ -640,8 +613,7 @@ of events which could cause this error i
 Here is an example of properly written code to use a database connection
 obtained from a connection pool:
 </p>
-<pre>
-  Connection conn = null;
+<source><![CDATA[  Connection conn = null;
   Statement stmt = null;  // Or PreparedStatement if needed
   ResultSet rs = null;
   try {
@@ -672,8 +644,7 @@ obtained from a connection pool:
       try { conn.close(); } catch (SQLException e) { ; }
       conn = null;
     }
-  }
-</pre>
+  }]]></source>
 
 </subsection>
 

Modified: tomcat/trunk/webapps/docs/jndi-resources-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/jndi-resources-howto.xml?rev=1518540&r1=1518539&r2=1518540&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/jndi-resources-howto.xml (original)
+++ tomcat/trunk/webapps/docs/jndi-resources-howto.xml Thu Aug 29 09:02:41 2013
@@ -108,18 +108,18 @@ elements in the <a href="config/context.
 element:</p>
 
 <ul>
-<li><a href="config/context.html#Environment Entries">&lt;Environment&gt;</a> -
+<li><a href="config/context.html#Environment_Entries">&lt;Environment&gt;</a> -
     Configure names and values for scalar environment entries that will be
     exposed to the web application through the JNDI
     <code>InitialContext</code> (equivalent to the inclusion of an
     <code>&lt;env-entry&gt;</code> element in the web application
     deployment descriptor).</li>
-<li><a href="config/context.html#Resource Definitions">&lt;Resource&gt;</a> -
+<li><a href="config/context.html#Resource_Definitions">&lt;Resource&gt;</a> -
     Configure the name and data type of a resource made available to the
     application (equivalent to the inclusion of a
     <code>&lt;resource-ref&gt;</code> element in the web application
     deployment descriptor).</li>
-<li><a href="config/context.html#Resource Links">&lt;ResourceLink&gt;</a> -
+<li><a href="config/context.html#Resource_Links">&lt;ResourceLink&gt;</a> -
     Add a link to a resource defined in the global JNDI context. Use resource
     links to give a web application access to a resource defined in
     the <a href="config/globalresources.html">&lt;GlobalNamingResources&gt;</a>
@@ -161,11 +161,11 @@ entire server.  These are configured in 
 <code><strong>&lt;GlobalNamingResources&gt;</strong></code></a> element of
 <code>$CATALINA_BASE/conf/server.xml</code>. You may expose these resources to
 web applications by using a
-<a href="config/context.html#Resource Links">&lt;ResourceLink&gt;</a> to
+<a href="config/context.html#Resource_Links">&lt;ResourceLink&gt;</a> to
 include it in the per-web-application context.</p>
 
 <p>If a resource has been defined using a
-<a href="config/context.html#Resource Links">&lt;ResourceLink&gt;</a>, it is not
+<a href="config/context.html#Resource_Links">&lt;ResourceLink&gt;</a>, it is not
 necessary for that resource to be defined in <code>/WEB-INF/web.xml</code>.
 However, it is recommended to keep the entry in <code>/WEB-INF/web.xml</code>
 to document the resource requirements for the web application.</p>
@@ -181,8 +181,7 @@ the <code>java:comp/env</code> portion o
 access to a resource - in this case, to a JDBC <code>DataSource</code> -
 would look something like this:</p>
 
-<source>
-// Obtain our environment naming context
+<source><![CDATA[// Obtain our environment naming context
 Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup("java:comp/env");
 
@@ -193,8 +192,7 @@ DataSource ds = (DataSource)
 // Allocate and use a connection from the pool
 Connection conn = ds.getConnection();
 ... use this connection to access the database ...
-conn.close();
-</source>
+conn.close();]]></source>
 
 </section>
 
@@ -208,7 +206,7 @@ conn.close();
   subsection below details the configuration and usage of the standard resource
   factories.</p>
 
-  <p>See <a href="#Adding Custom Resource Factories">Adding Custom
+  <p>See <a href="#Adding_Custom_Resource_Factories">Adding Custom
   Resource Factories</a> for information about how to create, install,
   configure, and use your own custom resource factory classes with
   Tomcat.</p>
@@ -223,7 +221,7 @@ conn.close();
 
   <subsection name="Generic JavaBean Resources">
 
-    <h3>0.  Introduction</h3>
+    <h5>0.  Introduction</h5>
 
     <p>This resource factory can be used to create objects of <em>any</em>
     Java class that conforms to standard JavaBeans naming conventions (i.e.
@@ -234,15 +232,14 @@ conn.close();
 
     <p>The steps required to use this facility are described below.</p>
 
-    <h3>1.  Create Your JavaBean Class</h3>
+    <h5>1.  Create Your JavaBean Class</h5>
 
     <p>Create the JavaBean class which will be instantiated each time
     that the resource factory is looked up.  For this example, assume
     you create a class <code>com.mycompany.MyBean</code>, which looks
     like this:</p>
 
-<source>
-package com.mycompany;
+<source><![CDATA[package com.mycompany;
 
 public class MyBean {
 
@@ -267,29 +264,26 @@ public class MyBean {
   }
 
 
-}
-</source>
+}]]></source>
 
-  <h3>2.  Declare Your Resource Requirements</h3>
+  <h5>2.  Declare Your Resource Requirements</h5>
 
   <p>Next, modify your web application deployment descriptor
   (<code>/WEB-INF/web.xml</code>) to declare the JNDI name under which
   you will request new instances of this bean.  The simplest approach is
   to use a <code>&lt;resource-env-ref&gt;</code> element, like this:</p>
 
-<source>
-&lt;resource-env-ref&gt;
-  &lt;description&gt;
+<source><![CDATA[<resource-env-ref>
+  <description>
     Object factory for MyBean instances.
-  &lt;/description&gt;
-  &lt;resource-env-ref-name&gt;
+  </description>
+  <resource-env-ref-name>
     bean/MyBeanFactory
-  &lt;/resource-env-ref-name&gt;
-  &lt;resource-env-ref-type&gt;
+  </resource-env-ref-name>
+  <resource-env-ref-type>
     com.mycompany.MyBean
-  &lt;/resource-env-ref-type&gt;
-&lt;/resource-env-ref&gt;
-</source>
+  </resource-env-ref-type>
+</resource-env-ref>]]></source>
 
     <p><strong>WARNING</strong> - Be sure you respect the element ordering
     that is required by the DTD for web application deployment descriptors!
@@ -297,36 +291,32 @@ public class MyBean {
     <a href="http://wiki.apache.org/tomcat/Specifications">Servlet
     Specification</a> for details.</p>
 
-  <h3>3.  Code Your Application's Use Of This Resource</h3>
+  <h5>3.  Code Your Application's Use Of This Resource</h5>
 
   <p>A typical use of this resource environment reference might look
   like this:</p>
 
-<source>
-Context initCtx = new InitialContext();
+<source><![CDATA[Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup("java:comp/env");
 MyBean bean = (MyBean) envCtx.lookup("bean/MyBeanFactory");
 
 writer.println("foo = " + bean.getFoo() + ", bar = " +
-               bean.getBar());
-</source>
+               bean.getBar());]]></source>
 
-    <h3>4.  Configure Tomcat's Resource Factory</h3>
+    <h5>4.  Configure Tomcat's Resource Factory</h5>
 
     <p>To configure Tomcat's resource factory, add an element like this to the
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
     this web application.</p>
 
-<source>
-&lt;Context ...&gt;
+<source><![CDATA[<Context ...>
   ...
-  &lt;Resource name="bean/MyBeanFactory" auth="Container"
+  <Resource name="bean/MyBeanFactory" auth="Container"
             type="com.mycompany.MyBean"
             factory="org.apache.naming.factory.BeanFactory"
-            bar="23"/&gt;
+            bar="23"/>
   ...
-&lt;/Context&gt;
-</source>
+</Context>]]></source>
 
     <p>Note that the resource name (here, <code>bean/MyBeanFactory</code>
     must match the value specified in the web application deployment
@@ -341,7 +331,7 @@ writer.println("foo = " + bean.getFoo() 
 
   <subsection name="UserDatabase Resources">
 
-    <h3>0.  Introduction</h3>
+    <h5>0.  Introduction</h5>
 
     <p>UserDatabase resources are typically configured as global resources for
     use by a UserDatabase realm. Tomcat includes a UserDatabaseFactoory that
@@ -351,7 +341,7 @@ writer.println("foo = " + bean.getFoo() 
     <p>The steps required to set up a global UserDatabase resource are described
     below.</p>
 
-    <h3>1. Create/edit the XML file</h3>
+    <h5>1. Create/edit the XML file</h5>
 
     <p>The XMl file is typically located at
     <code>$CATALINA_BASE/conf/tomcat-users.xml</code> however, you are free to
@@ -359,32 +349,28 @@ writer.println("foo = " + bean.getFoo() 
     files are placed in <code>$CATALINA_BASE/conf</code>. A typical XML would
     look like:</p>
 
-<source>
-&lt;?xml version='1.0' encoding='utf-8'?&gt;
-&lt;tomcat-users&gt;
-  &lt;role rolename="tomcat"/&gt;
-  &lt;role rolename="role1"/&gt;
-  &lt;user username="tomcat" password="tomcat" roles="tomcat"/&gt;
-  &lt;user username="both" password="tomcat" roles="tomcat,role1"/&gt;
-  &lt;user username="role1" password="tomcat" roles="role1"/&gt;
-&lt;/tomcat-users&gt;
-</source>
+<source><![CDATA[<?xml version='1.0' encoding='utf-8'?>
+<tomcat-users>
+  <role rolename="tomcat"/>
+  <role rolename="role1"/>
+  <user username="tomcat" password="tomcat" roles="tomcat"/>
+  <user username="both" password="tomcat" roles="tomcat,role1"/>
+  <user username="role1" password="tomcat" roles="role1"/>
+</tomcat-users>]]></source>
 
-    <h3>2.  Declare Your Resource</h3>
+    <h5>2.  Declare Your Resource</h5>
 
     <p>Next, modify <code>$CATALINA_BASE/conf/server.xml</code> to create the
     UserDatabase resource based on your XMl file. It should look something like
     this:</p>
 
-<source>
-&lt;Resource name="UserDatabase"
+<source><![CDATA[<Resource name="UserDatabase"
           auth="Container"
           type="org.apache.catalina.UserDatabase"
           description="User database that can be updated and saved"
           factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
           pathname="conf/tomcat-users.xml"
-          readonly="false" /&gt;
-</source>
+          readonly="false" />]]></source>
 
     <p>The <code>pathname</code> attribute can be absolute or relative. If
     relative, it is relative to <code>$CATALINA_BASE</code>.</p>
@@ -396,7 +382,7 @@ writer.println("foo = " + bean.getFoo() 
     is running as. Ensure that these are appropriate to maintain the security
     of your installation.</p>
 
-    <h3>3.  Configure the Realm</h3>
+    <h5>3.  Configure the Realm</h5>
 
     <p>Configure a UserDatabase Realm to use this resource as described in the
     <a href="config/realm.html">Realm configuration documentation</a>.</p>
@@ -406,7 +392,7 @@ writer.println("foo = " + bean.getFoo() 
 
   <subsection name="JavaMail Sessions">
 
-    <h3>0.  Introduction</h3>
+    <h5>0.  Introduction</h5>
 
     <p>In many web applications, sending electronic mail messages is a
     required part of the system's functionality.  The
@@ -424,7 +410,7 @@ writer.println("foo = " + bean.getFoo() 
 
     <p>The steps required for this are outlined below.</p>
 
-    <h3>1.  Declare Your Resource Requirements</h3>
+    <h5>1.  Declare Your Resource Requirements</h5>
 
     <p>The first thing you should do is modify the web application deployment
     descriptor (<code>/WEB-INF/web.xml</code>) to declare the JNDI name under
@@ -433,25 +419,23 @@ writer.println("foo = " + bean.getFoo() 
     standard <code>java:comp/env</code> naming context that is the root of
     all provided resource factories.  A typical <code>web.xml</code> entry
     might look like this:</p>
-<source>
-&lt;resource-ref&gt;
-  &lt;description&gt;
+<source><![CDATA[<resource-ref>
+  <description>
     Resource reference to a factory for javax.mail.Session
     instances that may be used for sending electronic mail
     messages, preconfigured to connect to the appropriate
     SMTP server.
-  &lt;/description&gt;
-  &lt;res-ref-name&gt;
+  </description>
+  <res-ref-name>
     mail/Session
-  &lt;/res-ref-name&gt;
-  &lt;res-type&gt;
+  </res-ref-name>
+  <res-type>
     javax.mail.Session
-  &lt;/res-type&gt;
-  &lt;res-auth&gt;
+  </res-type>
+  <res-auth>
     Container
-  &lt;/res-auth&gt;
-&lt;/resource-ref&gt;
-</source>
+  </res-auth>
+</resource-ref>]]></source>
 
     <p><strong>WARNING</strong> - Be sure you respect the element ordering
     that is required by the DTD for web application deployment descriptors!
@@ -459,11 +443,10 @@ writer.println("foo = " + bean.getFoo() 
     <a href="http://wiki.apache.org/tomcat/Specifications">Servlet
     Specification</a> for details.</p>
 
-    <h3>2.  Code Your Application's Use Of This Resource</h3>
+    <h5>2.  Code Your Application's Use Of This Resource</h5>
 
     <p>A typical use of this resource reference might look like this:</p>
-<source>
-Context initCtx = new InitialContext();
+<source><![CDATA[Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup("java:comp/env");
 Session session = (Session) envCtx.lookup("mail/Session");
 
@@ -474,8 +457,7 @@ to[0] = new InternetAddress(request.getP
 message.setRecipients(Message.RecipientType.TO, to);
 message.setSubject(request.getParameter("subject"));
 message.setContent(request.getParameter("content"), "text/plain");
-Transport.send(message);
-</source>
+Transport.send(message);]]></source>
 
     <p>Note that the application uses the same resource reference name
     that was declared in the web application deployment descriptor.  This
@@ -483,21 +465,19 @@ Transport.send(message);
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element
     for the web application as described below.</p>
 
-    <h3>3.  Configure Tomcat's Resource Factory</h3>
+    <h5>3.  Configure Tomcat's Resource Factory</h5>
 
     <p>To configure Tomcat's resource factory, add an elements like this to the
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
     this web application.</p>
 
-<source>
-&lt;Context ...&gt;
+<source><![CDATA[<Context ...>
   ...
-  &lt;Resource name="mail/Session" auth="Container"
+  <Resource name="mail/Session" auth="Container"
             type="javax.mail.Session"
-            mail.smtp.host="localhost"/&gt;
+            mail.smtp.host="localhost"/>
   ...
-&lt;/Context&gt;
-</source>
+</Context>]]></source>
 
     <p>Note that the resource name (here, <code>mail/Session</code>) must
     match the value specified in the web application deployment descriptor.
@@ -517,9 +497,9 @@ Transport.send(message);
     then Tomcat&apos;s resource factory will configure and add a
     <code>javax.mail.Authenticator</code> to the mail session.</p>
 
-    <h3>4.  Install the JavaMail libraries</h3>
+    <h5>4.  Install the JavaMail libraries</h5>
 
-    <p><a href="http://www.oracle.com/technetwork/java/index-138643.html">
+    <p><a href="http://javamail.java.net/">
     Download the JavaMail API</a>.</p>
 
     <p>Unpackage the distribution and place mail.jar  into $CATALINA_HOME/lib so
@@ -529,13 +509,13 @@ Transport.send(message);
     it in the $CATALINA_HOME/lib location only.
     </p>
 
-    <h3>5.  Restart Tomcat</h3>
+    <h5>5.  Restart Tomcat</h5>
 
     <p>For the additional JAR to be visible to Tomcat, it is necessary for the
     Tomcat instance to be restarted.</p>
 
 
-    <h3>Example Application</h3>
+    <h5>Example Application</h5>
 
     <p>The <code>/examples</code> application included with Tomcat contains
     an example of utilizing this resource factory.  It is accessed via the
@@ -555,7 +535,7 @@ Transport.send(message);
 
   <subsection name="JDBC Data Sources">
 
-    <h3>0.  Introduction</h3>
+    <h5>0.  Introduction</h5>
 
     <p>Many web applications need to access a database via a JDBC driver,
     to support the functionality required by that application.  The Java EE
@@ -586,9 +566,9 @@ Transport.send(message);
     project.  However, it is possible to use any other connection pool
     that implements <code>javax.sql.DataSource</code>, by writing your
     own custom resource factory, as described
-    <a href="#Adding Custom Resource Factories">below</a>.</p>
+    <a href="#Adding_Custom_Resource_Factories">below</a>.</p>
 
-    <h3>1.  Install Your JDBC Driver</h3>
+    <h5>1.  Install Your JDBC Driver</h5>
 
     <p>Use of the <em>JDBC Data Sources</em> JNDI Resource Factory requires
     that you make an appropriate JDBC driver available to both Tomcat internal
@@ -597,7 +577,7 @@ Transport.send(message);
     <code>$CATALINA_HOME/lib</code> directory, which makes the driver
     available both to the resource factory and to your application.</p>
 
-    <h3>2.  Declare Your Resource Requirements</h3>
+    <h5>2.  Declare Your Resource Requirements</h5>
 
     <p>Next, modify the web application deployment descriptor
     (<code>/WEB-INF/web.xml</code>) to declare the JNDI name under
@@ -606,25 +586,23 @@ Transport.send(message);
     standard <code>java:comp/env</code> naming context that is the root of
     all provided resource factories.  A typical <code>web.xml</code> entry
     might look like this:</p>
-<source>
-&lt;resource-ref&gt;
-  &lt;description&gt;
+<source><![CDATA[<resource-ref>
+  <description>
     Resource reference to a factory for java.sql.Connection
     instances that may be used for talking to a particular
-    database that is configured in the &lt;Context&gt;
+    database that is configured in the <Context>
     configurartion for the web application.
-  &lt;/description&gt;
-  &lt;res-ref-name&gt;
+  </description>
+  <res-ref-name>
     jdbc/EmployeeDB
-  &lt;/res-ref-name&gt;
-  &lt;res-type&gt;
+  </res-ref-name>
+  <res-type>
     javax.sql.DataSource
-  &lt;/res-type&gt;
-  &lt;res-auth&gt;
+  </res-type>
+  <res-auth>
     Container
-  &lt;/res-auth&gt;
-&lt;/resource-ref&gt;
-</source>
+  </res-auth>
+</resource-ref>]]></source>
 
     <p><strong>WARNING</strong> - Be sure you respect the element ordering
     that is required by the DTD for web application deployment descriptors!
@@ -632,19 +610,17 @@ Transport.send(message);
     <a href="http://wiki.apache.org/tomcat/Specifications">Servlet
     Specification</a> for details.</p>
 
-    <h3>3.  Code Your Application's Use Of This Resource</h3>
+    <h5>3.  Code Your Application's Use Of This Resource</h5>
 
     <p>A typical use of this resource reference might look like this:</p>
-<source>
-Context initCtx = new InitialContext();
+<source><![CDATA[Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup("java:comp/env");
 DataSource ds = (DataSource)
   envCtx.lookup("jdbc/EmployeeDB");
 
 Connection conn = ds.getConnection();
 ... use this connection to access the database ...
-conn.close();
-</source>
+conn.close();]]></source>
 
     <p>Note that the application uses the same resource reference name that was
     declared in the web application deployment descriptor. This is matched up
@@ -652,16 +628,15 @@ conn.close();
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
     the web application as described below.</p>
 
-    <h3>4.  Configure Tomcat's Resource Factory</h3>
+    <h5>4.  Configure Tomcat's Resource Factory</h5>
 
     <p>To configure Tomcat's resource factory, add an element like this to the
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
     the web application.</p>
 
-<source>
-&lt;Context ...&gt;
+<source><![CDATA[<Context ...>
   ...
-  &lt;Resource name="jdbc/EmployeeDB"
+  <Resource name="jdbc/EmployeeDB"
             auth="Container"
             type="javax.sql.DataSource"
             username="dbusername"
@@ -669,10 +644,9 @@ conn.close();
             driverClassName="org.hsql.jdbcDriver"
             url="jdbc:HypersonicSQL:database"
             maxActive="8"
-            maxIdle="4"/&gt;
+            maxIdle="4"/>
   ...
-&lt;/Context&gt;
-</source>
+</Context>]]></source>
 
     <p>Note that the resource name (here, <code>jdbc/EmployeeDB</code>) must
     match the value specified in the web application deployment descriptor.</p>
@@ -807,10 +781,10 @@ conn.close();
   <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
   the web application. In the example below, we will create a factory that only
   knows how to create <code>com.mycompany.MyBean</code> beans from the
-  <a href="#Generic JavaBean Resources">Generic JavaBean Resources</a> example
+  <a href="#Generic_JavaBean_Resources">Generic JavaBean Resources</a> example
   above.</p>
 
-  <h3>1.  Write A Resource Factory Class</h3>
+  <h4>1.  Write A Resource Factory Class</h4>
 
   <p>You must write a class that implements the JNDI service provider
   <code>javax.naming.spi.ObjectFactory</code> inteface.  Every time your
@@ -839,8 +813,7 @@ conn.close();
   <p>To create a resource factory that knows how to produce <code>MyBean</code>
   instances, you might create a class like this:</p>
 
-<source>
-package com.mycompany;
+<source><![CDATA[package com.mycompany;
 
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -883,8 +856,7 @@ public class MyBeanFactory implements Ob
 
   }
 
-}
-</source>
+}]]></source>
 
   <p>In this example, we are unconditionally creating a new instance of
   the <code>com.mycompany.MyBean</code> class, and populating its properties
@@ -907,26 +879,24 @@ public class MyBeanFactory implements Ob
   files are visible to both Catalina internal resources and your web
   application.</p>
 
-  <h3>2.  Declare Your Resource Requirements</h3>
+  <h4>2.  Declare Your Resource Requirements</h4>
 
   <p>Next, modify your web application deployment descriptor
   (<code>/WEB-INF/web.xml</code>) to declare the JNDI name under which
   you will request new instances of this bean.  The simplest approach is
   to use a <code>&lt;resource-env-ref&gt;</code> element, like this:</p>
 
-<source>
-&lt;resource-env-ref&gt;
-  &lt;description&gt;
+<source><![CDATA[<resource-env-ref>
+  <description>
     Object factory for MyBean instances.
-  &lt;/description&gt;
-  &lt;resource-env-ref-name&gt;
+  </description>
+  <resource-env-ref-name>
     bean/MyBeanFactory
-  &lt;/resource-env-ref-name&gt;
-  &lt;resource-env-ref-type&gt;
+  </resource-env-ref-name>
+  <resource-env-ref-type>
     com.mycompany.MyBean
-  &lt;/resource-env-ref-type&gt;
-&lt;resource-env-ref&gt;
-</source>
+  </resource-env-ref-type>
+<resource-env-ref>]]></source>
 
     <p><strong>WARNING</strong> - Be sure you respect the element ordering
     that is required by the DTD for web application deployment descriptors!
@@ -934,36 +904,32 @@ public class MyBeanFactory implements Ob
     <a href="http://wiki.apache.org/tomcat/Specifications">Servlet
     Specification</a> for details.</p>
 
-  <h3>3.  Code Your Application's Use Of This Resource</h3>
+  <h4>3.  Code Your Application's Use Of This Resource</h4>
 
   <p>A typical use of this resource environment reference might look
   like this:</p>
 
-<source>
-Context initCtx = new InitialContext();
+<source><![CDATA[Context initCtx = new InitialContext();
 Context envCtx = (Context) initCtx.lookup("java:comp/env");
 MyBean bean = (MyBean) envCtx.lookup("bean/MyBeanFactory");
 
 writer.println("foo = " + bean.getFoo() + ", bar = " +
-               bean.getBar());
-</source>
+               bean.getBar());]]></source>
 
-    <h3>4.  Configure Tomcat's Resource Factory</h3>
+    <h4>4.  Configure Tomcat's Resource Factory</h4>
 
     <p>To configure Tomcat's resource factory, add an elements like this to the
     <a href="config/context.html"><code>&lt;Context&gt;</code></a> element for
     this web application.</p>
 
-<source>
-&lt;Context ...&gt;
+<source><![CDATA[<Context ...>
   ...
-  &lt;Resource name="bean/MyBeanFactory" auth="Container"
+  <Resource name="bean/MyBeanFactory" auth="Container"
             type="com.mycompany.MyBean"
             factory="com.mycompany.MyBeanFactory"
-            bar="23"/&gt;
+            bar="23"/>
   ...
-&lt;/Context&gt;
-</source>
+</Context>]]></source>
 
     <p>Note that the resource name (here, <code>bean/MyBeanFactory</code>
     must match the value specified in the web application deployment

Modified: tomcat/trunk/webapps/docs/logging.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/logging.xml?rev=1518540&r1=1518539&r2=1518540&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/logging.xml (original)
+++ tomcat/trunk/webapps/docs/logging.xml Thu Aug 29 09:02:41 2013
@@ -229,6 +229,7 @@
     JULI is enabled by default, and supports per classloader configuration, in
     addition to the regular global java.util.logging configuration. This means
     that logging can be configured at the following layers:
+  </p>
     <ul>
       <li>Globally. That is usually done in the
         <code>${catalina.base}/conf/logging.properties</code> file.
@@ -241,7 +242,6 @@
         <code>WEB-INF/classes/logging.properties</code>
       </li>
     </ul>
-  </p>
   <p>
     The default <code>logging.properties</code> in the JRE specifies a
     <code>ConsoleHandler</code> that routes logging to System.err.
@@ -260,9 +260,7 @@
     so FINEST or ALL should be set. Please refer to <code>java.util.logging</code>
     documentation in the JDK for the complete details:
   </p>
-  <p>
-    <source>org.apache.catalina.level=FINEST</source>
-  </p>
+  <source>org.apache.catalina.level=FINEST</source>
   <p>
     The configuration used by JULI is extremely similar to the one supported by
     plain <code>java.util.logging</code>, but uses a few
@@ -302,8 +300,8 @@
   </p>
   <p>
     Example logging.properties file to be placed in $CATALINA_BASE/conf:
-    <source>
-handlers = 1catalina.org.apache.juli.FileHandler, \
+  </p>
+  <source><![CDATA[handlers = 1catalina.org.apache.juli.FileHandler, \
            2localhost.org.apache.juli.FileHandler, \
            3manager.org.apache.juli.FileHandler, \
            java.util.logging.ConsoleHandler
@@ -347,15 +345,13 @@ org.apache.catalina.core.ContainerBase.[
 
 # For example, set the org.apache.catalina.util.LifecycleBase logger to log
 # each component that extends LifecycleBase changing state:
-#org.apache.catalina.util.LifecycleBase.level = FINE
-</source>
-    </p>
+#org.apache.catalina.util.LifecycleBase.level = FINE]]></source>
 
     <p>
       Example logging.properties for the servlet-examples web application to be
       placed in WEB-INF/classes inside the web application:
-      <source>
-handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
+    </p>
+    <source><![CDATA[handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
 
 ############################################################
 # Handler specific properties.
@@ -367,9 +363,8 @@ org.apache.juli.FileHandler.directory = 
 org.apache.juli.FileHandler.prefix = servlet-examples.
 
 java.util.logging.ConsoleHandler.level = FINE
-java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
-</source>
-    </p>
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter]]></source>
+
 
     <subsection name="Documentation references">
       <p>See the following resources for additional information:</p>
@@ -430,7 +425,7 @@ java.util.logging.ConsoleHandler.formatt
         <li>Create a file called <code>log4j.properties</code> with the
         following content and save it into <code>$CATALINA_BASE/lib</code></li>
     </ol>
-    <source>
+    <source><![CDATA[
 log4j.rootLogger = INFO, CATALINA
 
 # Define all the appenders
@@ -477,8 +472,7 @@ log4j.logger.org.apache.catalina.core.Co
 log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager] =\
   INFO, MANAGER
 log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager] =\
-  INFO, HOST-MANAGER
-</source>
+  INFO, HOST-MANAGER]]></source>
     <ol start="2">
         <li><a href="http://logging.apache.org/log4j">Download Log4J</a>
         (v1.2 or later).</li>
@@ -553,11 +547,9 @@ log4j.logger.org.apache.catalina.core.Co
       configuration files, so we recommend you use a properties file as
       described until a future version of log4j allows this convention.
     </p>
-      <source>
-log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG<br/>
-log4j.logger.org.apache.catalina.core=DEBUG<br/>
-log4j.logger.org.apache.catalina.session=DEBUG<br/>
-      </source>
+      <source><![CDATA[log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG
+log4j.logger.org.apache.catalina.core=DEBUG
+log4j.logger.org.apache.catalina.session=DEBUG]]></source>
 
     <p>
       Be warned: a level of DEBUG will produce megabytes of logging and slow



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org