cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs/config context.xml resources.xml

2004-11-19 Thread markt
markt   2004/11/19 12:52:02

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
   catalina/src/share/org/apache/catalina/mbeans
mbeans-descriptors.xml
   webapps/tomcat-docs/config context.xml resources.xml
  Log:
  Fix bug 21818. allowLinking now remembered across web app reload.
  Also remembers caseSensitive, cached, and cacheTTL. Added new
  attributes to docs.
   - based a Remy's patch for a similar issue in TC5
  
  Revision  ChangesPath
  1.126 +80 -2 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.125
  retrieving revision 1.126
  diff -u -r1.125 -r1.126
  --- StandardContext.java  26 Aug 2004 21:32:20 -  1.125
  +++ StandardContext.java  19 Nov 2004 20:52:02 -  1.126
  @@ -134,7 +134,6 @@
*/
   private boolean available = false;
   
  -
   /**
* The Locale to character set mapper for this application.
*/
  @@ -417,6 +416,24 @@
   
   
   /**
  + * Case sensitivity.
  + */
  +protected boolean caseSensitive = true;
  +
  +
  +/**
  + * Allow linking.
  + */
  +protected boolean allowLinking = false;
  +
  +
  +/**
  + * Cache TTL in ms.
  + */
  +protected int cacheTTL = 5000;
  +
  +
  +/**
* Caching allowed flag.
*/
   protected boolean cachingAllowed = true;
  @@ -427,6 +444,7 @@
*/
   protected DirContext webappResources = null;
   
  +
   
   // - Context 
Properties
   
  @@ -447,6 +465,55 @@
   }
   
   
  +
  +/**
  + * Set case sensitivity.
  + */
  +public void setCaseSensitive(boolean caseSensitive) {
  +this.caseSensitive = caseSensitive;
  +}
  +
  +
  +/**
  + * Is case sensitive ?
  + */
  +public boolean isCaseSensitive() {
  +return caseSensitive;
  +}
  +
  +
  +/**
  + * Set allow linking.
  + */
  +public void setAllowLinking(boolean allowLinking) {
  +this.allowLinking = allowLinking;
  +}
  +
  +
  +/**
  + * Is linking allowed.
  + */
  +public boolean isAllowLinking() {
  +return allowLinking;
  +}
  +
  +
  +/**
  + * Set cache TTL.
  + */
  +public void setCacheTTL(int cacheTTL) {
  +this.cacheTTL = cacheTTL;
  +}
  +
  +
  +/**
  + * Get cache TTL.
  + */
  +public int getCacheTTL() {
  +return cacheTTL;
  +}
  +
  +
   /**
* Returns true if the internal naming support is used.
*/
  @@ -3281,8 +3348,19 @@
   try {
   ProxyDirContext proxyDirContext = 
   new ProxyDirContext(env, webappResources);
  +if (webappResources instanceof FileDirContext) {
  +filesystemBased = true;
  +((FileDirContext) webappResources).setCaseSensitive
  +(isCaseSensitive());
  +((FileDirContext) webappResources).setAllowLinking
  +(isAllowLinking());
  +}
  +
   if (webappResources instanceof BaseDirContext) {
   ((BaseDirContext) webappResources).setDocBase(getBasePath());
  +((BaseDirContext) webappResources).setCached
  +(isCachingAllowed());
  +((BaseDirContext) 
webappResources).setCacheTTL(getCacheTTL());
   ((BaseDirContext) webappResources).allocate();
   }
   this.resources = proxyDirContext;
  
  
  
  1.83  +18 -4 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml
  
  Index: mbeans-descriptors.xml
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/mbeans/mbeans-descriptors.xml,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- mbeans-descriptors.xml25 Jan 2004 23:07:16 -  1.82
  +++ mbeans-descriptors.xml19 Nov 2004 20:52:02 -  1.83
  @@ -2072,9 +2072,23 @@
   group=Context
type=org.apache.catalina.core.StandardContext
   
  -attribute   name=cookies
  -  description=Should we attempt to use cookies for session id
  -communication?
  +attribute   name=allowLinking
  +  description=Allow symlinking to outside the webapp root 
directory, if the webapp is an exploded directory
  +   is=true
  + type=boolean/
  +
  +attribute   

cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs/config context.xml resources.xml

2004-03-16 Thread markt
markt   2004/03/16 15:23:33

  Modified:catalina/src/share/org/apache/catalina/core
StandardContext.java
   webapps/tomcat-docs/config context.xml resources.xml
  Log:
  Fix bug 18079.
  - Modify StandardContext so cached attribute of resources has an effect
  - Update docs to reflect changes
  - Remove unused imports highlighted by Eclipse
  - Reported by 'gawix'
  
  Revision  ChangesPath
  1.123 +8 -25 
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- StandardContext.java  27 Dec 2003 20:37:58 -  1.122
  +++ StandardContext.java  16 Mar 2004 23:23:33 -  1.123
  @@ -69,35 +69,18 @@
   import java.io.IOException;
   import java.util.ArrayList;
   import java.util.HashMap;
  -import java.net.URL;
   import java.util.Iterator;
   import java.util.TreeMap;
   import java.util.Hashtable;
   import java.util.Stack;
  -import java.util.Enumeration;
  -import java.util.StringTokenizer;
   import javax.servlet.FilterConfig;
   import javax.servlet.ServletContext;
   import javax.servlet.ServletContextEvent;
   import javax.servlet.ServletContextListener;
   import javax.servlet.ServletException;
  -import javax.servlet.http.HttpServletRequest;
  -import javax.servlet.http.HttpServletResponse;
   import javax.naming.NamingException;
  -import javax.naming.InitialContext;
  -import javax.naming.Reference;
  -import javax.naming.StringRefAddr;
  -import javax.naming.NamingEnumeration;
  -import javax.naming.Binding;
  -import javax.naming.StringRefAddr;
   import javax.naming.directory.DirContext;
  -import org.apache.naming.NamingContext;
   import org.apache.naming.ContextBindings;
  -import org.apache.naming.ContextAccessController;
  -import org.apache.naming.EjbRef;
  -import org.apache.naming.ResourceRef;
  -import org.apache.naming.ResourceEnvRef;
  -import org.apache.naming.TransactionRef;
   import org.apache.naming.resources.BaseDirContext;
   import org.apache.naming.resources.FileDirContext;
   import org.apache.naming.resources.ProxyDirContext;
  @@ -106,10 +89,8 @@
   import org.apache.catalina.Container;
   import org.apache.catalina.ContainerListener;
   import org.apache.catalina.Context;
  -import org.apache.catalina.Engine;
   import org.apache.catalina.Host;
   import org.apache.catalina.Globals;
  -import org.apache.catalina.HttpRequest;
   import org.apache.catalina.InstanceListener;
   import org.apache.catalina.Lifecycle;
   import org.apache.catalina.LifecycleEvent;
  @@ -134,7 +115,6 @@
   import org.apache.catalina.deploy.ResourceParams;
   import org.apache.catalina.deploy.SecurityCollection;
   import org.apache.catalina.deploy.SecurityConstraint;
  -import org.apache.catalina.loader.StandardClassLoader;
   import org.apache.catalina.loader.WebappLoader;
   import org.apache.catalina.session.StandardManager;
   import org.apache.catalina.util.CharsetMapper;
  @@ -1168,7 +1148,10 @@
   return;
   
   if (resources instanceof BaseDirContext) {
  -((BaseDirContext) resources).setCached(isCachingAllowed());
  +((BaseDirContext) resources).setCached(
  +isCachingAllowed() 
  +((BaseDirContext) resources).isCached()
  +);
   }
   if (resources instanceof FileDirContext) {
   filesystemBased = true;
  
  
  
  1.13  +7 -0  jakarta-tomcat-4.0/webapps/tomcat-docs/config/context.xml
  
  Index: context.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/tomcat-docs/config/context.xml,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- context.xml   12 Jan 2003 17:26:48 -  1.12
  +++ context.xml   16 Mar 2004 23:23:33 -  1.13
  @@ -169,6 +169,13 @@
   
   attributes
   
  +  attribute name=cachingAllowed required=false
  +pThis boolean flag indicates if the resources may be cached. It
  +defaults to codetrue/code. If set to codefalse/code, this
  +flag overrides the emcached/em attribute of any contained
  +a href=resources.htmlResources/a
 element./p
  +  /attribute
  +
 attribute name=debug required=false
   pThe level of debugging detail logged by this strongEngine/strong
   to the associated a href=logger.htmlLogger/a.  Higher numbers
  
  
  
  1.3   +3 -1  jakarta-tomcat-4.0/webapps/tomcat-docs/config/resources.xml
  
  Index: resources.xml
  ===
  RCS file: