From: fhanik Date: Fri, 20 Jul 2007 22:31:38 +0000 (+0000) Subject: up sync from 6.0 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=581998e8d2768d2d07cf911ddd4ce0298a26fe74;p=tomcat7.0 up sync from 6.0 http://svn.apache.org/viewvc?view=rev&rev=556453 http://svn.apache.org/viewvc?view=rev&rev=556489 http://svn.apache.org/viewvc?view=rev&rev=556767 git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@558181 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/startup/ContextConfig.java b/java/org/apache/catalina/startup/ContextConfig.java index 1b5454603..7ea2b2987 100644 --- a/java/org/apache/catalina/startup/ContextConfig.java +++ b/java/org/apache/catalina/startup/ContextConfig.java @@ -881,12 +881,12 @@ public class ContextConfig file = new File(docBase); String origDocBase = docBase; + String contextPath = context.getPath(); + if (contextPath.equals("")) { + contextPath = "ROOT"; + } if (docBase.toLowerCase().endsWith(".war") && !file.isDirectory() && unpackWARs) { URL war = new URL("jar:" + (new File(docBase)).toURL() + "!/"); - String contextPath = context.getPath(); - if (contextPath.equals("")) { - contextPath = "ROOT"; - } docBase = ExpandWar.expand(host, war, contextPath); file = new File(docBase); docBase = file.getCanonicalPath(); @@ -900,7 +900,7 @@ public class ContextConfig if (warFile.exists()) { if (unpackWARs) { URL war = new URL("jar:" + warFile.toURL() + "!/"); - docBase = ExpandWar.expand(host, war, context.getPath()); + docBase = ExpandWar.expand(host, war, contextPath); file = new File(docBase); docBase = file.getCanonicalPath(); } else { diff --git a/webapps/docs/jndi-datasource-examples-howto.xml b/webapps/docs/jndi-datasource-examples-howto.xml index 8749dc6be..bb548f8c7 100644 --- a/webapps/docs/jndi-datasource-examples-howto.xml +++ b/webapps/docs/jndi-datasource-examples-howto.xml @@ -42,10 +42,10 @@ know if you have any other tested configurations that you feel may be of use to the wider audience, or if you feel we can improve this section in anyway.

-Please note that JNDI resource configuration has changed somewhat between -Tomcat 5.0.x and Tomcat 5.5.x. You will most likely need to modify your JNDI -resource configurations to match the syntax in the example below in order -to make them work in Tomcat 5.5.x. +Please note that JNDI resource configuration changed somewhat between +Tomcat 5.0.x and Tomcat 5.5.x. You will most likely need to modify older +JNDI resource configurations to match the syntax in the example below in order +to make them work in Tomcat 6.x.x.

@@ -192,15 +192,10 @@ mysql>

-

2. server.xml configuration

+

2. Context configuration

Configure the JNDI DataSource in Tomcat by adding a declaration for your -resource to $CATALINA_HOME/conf/server.xml.

-

Add this in between the </Context> tag of the examples -context and the </Host> tag closing the localhost definition. -If there is no such tag, you can add one as illustrated in the -Context and -Host configuration references, and repeated below -for your convenience. +resource to your Context.

+

For example: <Context path="/DBTest" docBase="DBTest" @@ -316,22 +311,19 @@ or classes12.zip will need to be renamed with a .jar extension. Since jarfiles are zipfiles, there is no need to unzip and jar these files - a simple rename will suffice.

-

Some early versions of Tomcat 4.0 when used with JDK 1.4 will not load -classes12.zip unless you unzip the file, remove the javax.sql.* -class heirarchy and rejar.

-

For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather than oracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release.

-

1. server.xml configuration

+

1. Context configuration

In a similar manner to the mysql config above, you will need to define your -Datasource in your server.xml file. Here we define a Datasource called myoracle -using the thin driver to connect as user scott, password tiger to the sid -called mysid. (Note: with the thin driver this sid is not the same as the -tnsname). The schema used will be the default schema for the user scott.

+Datasource in your Context. Here we define a +Datasource called myoracle using the thin driver to connect as user scott, +password tiger to the sid called mysid. (Note: with the thin driver this sid is +not the same as the tnsname). The schema used will be the default schema for the +user scott.

Use of the OCI driver should simply involve a changing thin to oci in the URL string. @@ -344,7 +336,7 @@ tnsname). The schema used will be the default schema for the user scott.

2. web.xml configuration

-

You should ensure that you respect the elemeent ordering defined by the DTD when you +

You should ensure that you respect the element ordering defined by the DTD when you create you applications web.xml file.

<resource-ref> @@ -409,10 +401,8 @@ Tomcat installation.

-Create a resource definition file for your application defining the -datasource. This file must have the same name as your application, so if -your application deploys as someApp.war, this filename must -be someApp.xml. This file should look something like the following. +Create a resource definition for your Context. +The Context element should look something like the following.

diff --git a/webapps/docs/manager-howto.xml b/webapps/docs/manager-howto.xml index 8b44cb1fe..4bc3fc7ce 100644 --- a/webapps/docs/manager-howto.xml +++ b/webapps/docs/manager-howto.xml @@ -82,22 +82,16 @@ the following functions:

directory (unless it was deployed from file system). -

There are two ways to configure the Manager web application -Context: -

If you have Tomcat configured to support multiple virtual hosts