Re: cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core StandardContext.java StandardHost.java

2001-01-21 Thread Craig R. McClanahan

Remy Maucherat wrote:

  On 20 Jan 2001 [EMAIL PROTECTED] wrote:
 
 - Add a new "unpackWARs" flag in the StandardHost : if true, the host
 will
   deploy WARs as before. If false, the WARs found in the host path
 won't
   be unpacked and the WARDirContext will be used.
 
  Very very cool.

 :)
 I guess I get the award for "Fanciest New Feature of the Week".
 It breaks Jasper, so it's disabled by default.


Once we're satisfied that the new resources stuff works, I will vote for
modifying Jasper to utilize it (via a JNDI InitialContext) so that it won't
matter whether or not you are running out of a WAR file.


 Remy


Craig McClanahan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core StandardContext.java StandardHost.java

2001-01-20 Thread remm

remm01/01/20 11:41:30

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java StandardHost.java
  Log:
  - StandardContext will now use the new WARDirContext if the url given ends
with ".war".
  - Add a new "unpackWARs" flag in the StandardHost : if true, the host will
deploy WARs as before. If false, the WARs found in the host path won't
be unpacked and the WARDirContext will be used.
  
  Revision  ChangesPath
  1.37  +12 -6 
jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- StandardContext.java  2001/01/14 19:58:30 1.36
  +++ StandardContext.java  2001/01/20 19:41:29 1.37
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.36 2001/01/14 19:58:30 remm Exp $
  - * $Revision: 1.36 $
  - * $Date: 2001/01/14 19:58:30 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.37 2001/01/20 19:41:29 remm Exp $
  + * $Revision: 1.37 $
  + * $Date: 2001/01/20 19:41:29 $
*
* 
*
  @@ -97,6 +97,7 @@
   import org.apache.naming.ResourceEnvRef;
   import org.apache.naming.TransactionRef;
   import org.apache.naming.resources.FileDirContext;
  +import org.apache.naming.resources.WARDirContext;
   import org.apache.naming.resources.BaseDirContext;
   import org.apache.catalina.Container;
   import org.apache.catalina.ContainerListener;
  @@ -136,7 +137,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.36 $ $Date: 2001/01/14 19:58:30 $
  + * @version $Revision: 1.37 $ $Date: 2001/01/20 19:41:29 $
*/
   
   public class StandardContext
  @@ -2911,7 +2912,10 @@
   if (getResources() == null) {   // (1) Required by Loader
   if (debug = 1)
   log("Configuring default Resources");
  -setResources(new FileDirContext());
  +if ((docBase != null)  (docBase.endsWith(".war")))
  +setResources(new WARDirContext());
  +else
  +setResources(new FileDirContext());
   }
   if (getLoader() == null) {  // (2) Required by Manager
   if (debug = 1)
  @@ -2924,6 +2928,9 @@
   setManager(new StandardManager());
   }
   
  +// Post work directory
  + postWorkDirectory();
  +
// Standard container startup
   if (debug = 1)
   log("Processing standard container startup");
  @@ -2961,7 +2968,6 @@
   if (debug = 1)
   log("Posting standard context attributes");
postWelcomeFiles();
  - postWorkDirectory();
   
   // Reload sessions from persistent storage if supported
   try {
  
  
  
  1.7   +64 -21
jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardHost.java
  
  Index: StandardHost.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- StandardHost.java 2000/12/07 19:37:41 1.6
  +++ StandardHost.java 2001/01/20 19:41:29 1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
 1.6 2000/12/07 19:37:41 pier Exp $
  - * $Revision: 1.6 $
  - * $Date: 2000/12/07 19:37:41 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardHost.java,v
 1.7 2001/01/20 19:41:29 remm Exp $
  + * $Revision: 1.7 $
  + * $Date: 2001/01/20 19:41:29 $
*
* 
*
  @@ -97,7 +97,7 @@
* requests directed to a particular web application.
*
* @author Craig R. McClanahan
  - * @version $Revision: 1.6 $ $Date: 2000/12/07 19:37:41 $
  + * @version $Revision: 1.7 $ $Date: 2001/01/20 19:41:29 $
*/
   
   public class StandardHost
  @@ -173,6 +173,12 @@
"org.apache.catalina.core.StandardHostMapper";
   
   
  +/**
  + * Unpack WARs property.
  + */
  +private boolean unpackWARs = true;
  +
  +
   // - Properties
   
   
  @@ -290,6 +296,26 @@
   }
   
   
  +/**
  + * Unpack WARs flag accessor.
  + */
  +public boolean isUnpackWARs() {
  +
  +return (unpackWARs);
  +
  +}
  +
  

Re: cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core StandardContext.java StandardHost.java

2001-01-20 Thread Remy Maucherat

 On 20 Jan 2001 [EMAIL PROTECTED] wrote:

- Add a new "unpackWARs" flag in the StandardHost : if true, the host
will
  deploy WARs as before. If false, the WARs found in the host path
won't
  be unpacked and the WARDirContext will be used.

 Very very cool.

:)
I guess I get the award for "Fanciest New Feature of the Week".
It breaks Jasper, so it's disabled by default.

Remy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core StandardContext.java

2001-01-12 Thread remm

remm01/01/12 21:20:49

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
  Log:
  - Fix path initialization of the DirContext.
  
  Revision  ChangesPath
  1.35  +15 -10
jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- StandardContext.java  2001/01/12 06:50:06 1.34
  +++ StandardContext.java  2001/01/13 05:20:49 1.35
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.34 2001/01/12 06:50:06 remm Exp $
  - * $Revision: 1.34 $
  - * $Date: 2001/01/12 06:50:06 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.1/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.35 2001/01/13 05:20:49 remm Exp $
  + * $Revision: 1.35 $
  + * $Date: 2001/01/13 05:20:49 $
*
* 
*
  @@ -136,7 +136,7 @@
*
* @author Craig R. McClanahan
* @author Remy Maucherat
  - * @version $Revision: 1.34 $ $Date: 2001/01/12 06:50:06 $
  + * @version $Revision: 1.35 $ $Date: 2001/01/13 05:20:49 $
*/
   
   public class StandardContext
  @@ -922,12 +922,17 @@
   if (container == null) {
   docBase = (new File(engineBase(), getDocBase())).getPath();
   } else {
  -// Use the "appBase" property of this container
  -String appBase = ((Host) container).getAppBase();
  -File file = new File(appBase);
  -if (!file.isAbsolute())
  -file = new File(engineBase(), appBase);
  -docBase = (new File(file, getDocBase())).getPath();
  +File file = new File(getDocBase());
  +if (!file.isAbsolute()) {
  +// Use the "appBase" property of this container
  +String appBase = ((Host) container).getAppBase();
  +file = new File(appBase);
  +if (!file.isAbsolute())
  +file = new File(engineBase(), appBase);
  +docBase = (new File(file, getDocBase())).getPath();
  +} else {
  +docBase = file.getPath();
  +}
   }
   ((BaseDirContext) resources).setDocBase(docBase);
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]