tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/resources LocalStrings.properties LocalStrings_en.properties LocalStrings_es.properties
Date Fri, 22 Sep 2000 04:07:21 GMT
larryi      00/09/21 21:07:19

  Modified:    src/etc  Tag: tomcat_32 server.xml
               src/share/org/apache/tomcat/context Tag: tomcat_32
                        DefaultCMSetter.java
               src/share/org/apache/tomcat/core Tag: tomcat_32
                        ContextManager.java
               src/share/org/apache/tomcat/resources Tag: tomcat_32
                        LocalStrings.properties LocalStrings_en.properties
                        LocalStrings_es.properties
  Log:
  Add showStackTraces attribute to the ContextManager to control the
  display of stack traces in the default response for exceptions.
  
  Added showStackTraces="true" to ContextManager in server.xml to
  help show that this feature is present and on by default.
  
  Added a space after the colons in the resource text strings used in
  the exception response.  When stack traces are disabled, the
  exception message will follow the colon on the same line.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.29.2.5  +8 -2      jakarta-tomcat/src/etc/server.xml
  
  Index: server.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v
  retrieving revision 1.29.2.4
  retrieving revision 1.29.2.5
  diff -u -r1.29.2.4 -r1.29.2.5
  --- server.xml	2000/09/13 01:55:28	1.29.2.4
  +++ server.xml	2000/09/22 04:07:13	1.29.2.5
  @@ -80,15 +80,21 @@
       <!-- You can add a "home" attribute to represent the "base" for 
            all relative paths. If none is set, the TOMCAT_HOME property
            will be used, and if not set "." will be used.
  -         webapps/, work/ and log/ will be relative to this ( unless 
  +         webapps/, work/ and logs/ will be relative to this ( unless 
            set explicitely to absolute paths ).
  +
            You can also specify a "randomClass" attribute, which determines 
            a subclass of java.util.Random will be used for generating session IDs.
            By default this is "java.security.SecureRandom". 
            Specifying "java.util.Random" will speed up Tomcat startup, 
            but it will cause sessions to be less secure.
  +
  +         You can specify the "showStackTraces" attribute to control
  +         whether stack traces are displayed in the default response
  +         for exceptions.  The default is "true", so you must specify
  +         "false" to prevent stack traces from appearing.
         -->
  -    <ContextManager debug="0" workDir="work" >
  +    <ContextManager debug="0" workDir="work" showStackTraces="true" >
   
         <!-- ==================== Interceptors ==================== -->
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.45.2.5  +31 -16    jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java
  
  Index: DefaultCMSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java,v
  retrieving revision 1.45.2.4
  retrieving revision 1.45.2.5
  diff -u -r1.45.2.4 -r1.45.2.5
  --- DefaultCMSetter.java	2000/09/21 23:42:04	1.45.2.4
  +++ DefaultCMSetter.java	2000/09/22 04:07:14	1.45.2.5
  @@ -232,33 +232,48 @@
   	    .append("</h2>");
   
   	buf.append("<b>")
  -	    .append(sm.getString("defaulterrorpage.internalservleterror"))
  -	    .append("</b><br>");
  +	    .append(sm.getString("defaulterrorpage.internalservleterror"));
   
  -	buf.append("<pre>");
  +	if (contextM.getShowStackTraces()) {
  +	    buf.append("</b><br>");
   
  -	StringWriter sw = new StringWriter();
  -	PrintWriter pw = new PrintWriter(sw);
  -	e.printStackTrace(pw);
  +	    buf.append("<pre>");
  +
  +	    StringWriter sw = new StringWriter();
  +	    PrintWriter pw = new PrintWriter(sw);
  +	    e.printStackTrace(pw);
   
  -	buf.append(sw.toString());
  +	    buf.append(sw.toString());
   
  -	buf.append("</pre>\r\n");
  +	    buf.append("</pre>\r\n");
  +	} else {
  +	    buf.append("</b>")
  +    	        .append(e.getMessage())
  +		.append("<br>\r\n");
  +	}
   
           if (e instanceof ServletException) {
   	    Throwable cause = ((ServletException)e).getRootCause();
   	    if (cause != null) {
   		buf.append("<b>")
  -		    .append(sm.getString("defaulterrorpage.rootcause"))
  -		    .append("</b>\r\n");
  -	    buf.append("<pre>");
  +		    .append(sm.getString("defaulterrorpage.rootcause"));
   
  -	    sw=new StringWriter();
  -	    pw=new PrintWriter(sw);
  -	    cause.printStackTrace( pw );
  -	    buf.append( sw.toString());
  +		if (contextM.getShowStackTraces()) {
  +		    buf.append("</b>\r\n");
   
  -	    buf.append("</pre>\r\n");
  +		    buf.append("<pre>");
  +
  +		    StringWriter sw = new StringWriter();
  +		    PrintWriter pw = new PrintWriter(sw);
  +		    cause.printStackTrace( pw );
  +		    buf.append( sw.toString());
  +
  +		    buf.append("</pre>\r\n");
  +		} else {
  +		    buf.append("</b>")
  +			.append(cause.getMessage())
  +			.append("\r\n");
  +		}
   	    }
   	}
   	
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.100.2.9 +20 -0     jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.100.2.8
  retrieving revision 1.100.2.9
  diff -u -r1.100.2.8 -r1.100.2.9
  --- ContextManager.java	2000/09/21 10:35:53	1.100.2.8
  +++ ContextManager.java	2000/09/22 04:07:15	1.100.2.9
  @@ -167,6 +167,11 @@
   
       // port for SSL endpoint - for redirect
       int securePort=-1;
  +
  +    /** The setting which controls display of stack traces
  +     *  in the default exception handling
  +     */
  +    boolean showStackTraces = true;
       
       /** Default work dir, relative to home
        */
  @@ -325,6 +330,21 @@
       public void setRandomClass(String randomClass) {
           System.setProperty("tomcat.sessionid.randomclass", randomClass);
       }
  +
  +    /** Get the showStackTraces property to be used for controlling the display of
  +     *  stack traces in the default response for exceptions.
  +     **/
  +    public boolean getShowStackTraces() {
  +	return showStackTraces;
  +    }
  +    
  +    /** Sets the showStackTraces property used for controlling the display of
  +     *  stack traces in the default response for exceptions.
  +     */
  +    public void setShowStackTraces(boolean showStackTraces) {
  +	this.showStackTraces = showStackTraces;
  +    }
  +	
   
       // -------------------- Support functions --------------------
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings.properties,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- LocalStrings.properties	2000/06/23 15:14:35	1.4
  +++ LocalStrings.properties	2000/09/22 04:07:16	1.4.2.1
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings.properties,v 1.4 2000/06/23 15:14:35 costin Exp $
  +# $Id: LocalStrings.properties,v 1.4.2.1 2000/09/22 04:07:16 larryi Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -15,10 +15,10 @@
   defaulterrorpage.includedservlet=Included servlet error:
   defaulterrorpage.location=Location:
   defaulterrorpage.notfound404=Not Found (404)
  -defaulterrorpage.rootcause=Root cause:
  +defaulterrorpage.rootcause=Root cause: 
   defaulterrorpage.documentmoved=Document moved
   defaulterrorpage.thisdocumenthasmoved=This document has moved
  -defaulterrorpage.internalservleterror=Internal Servlet Error:
  +defaulterrorpage.internalservleterror=Internal Servlet Error: 
   
   #Tomcat.java
   tomcat.usage=usage: 
  
  
  
  1.1.2.3   +2 -2      jakarta-tomcat/src/share/org/apache/tomcat/resources/Attic/LocalStrings_en.properties
  
  Index: LocalStrings_en.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/resources/Attic/LocalStrings_en.properties,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- LocalStrings_en.properties	2000/07/06 23:26:11	1.1.2.2
  +++ LocalStrings_en.properties	2000/09/22 04:07:17	1.1.2.3
  @@ -15,10 +15,10 @@
   defaulterrorpage.includedservlet=Included servlet error:
   defaulterrorpage.location=Location:
   defaulterrorpage.notfound404=Not Found (404)
  -defaulterrorpage.rootcause=Root cause:
  +defaulterrorpage.rootcause=Root cause: 
   defaulterrorpage.documentmoved=Document moved
   defaulterrorpage.thisdocumenthasmoved=This document has moved
  -defaulterrorpage.internalservleterror=Internal Servlet Error:
  +defaulterrorpage.internalservleterror=Internal Servlet Error: 
   
   #Tomcat.java
   tomcat.usage=usage: 
  
  
  
  1.4.2.1   +3 -3      jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings_es.properties
  
  Index: LocalStrings_es.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/resources/LocalStrings_es.properties,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- LocalStrings_es.properties	2000/06/23 15:14:36	1.4
  +++ LocalStrings_es.properties	2000/09/22 04:07:19	1.4.2.1
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings_es.properties,v 1.4 2000/06/23 15:14:36 costin Exp $
  +# $Id: LocalStrings_es.properties,v 1.4.2.1 2000/09/22 04:07:19 larryi Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -14,10 +14,10 @@
   defaulterrorpage.Includedservlet=Error en el Servlet Incluido:
   defaulterrorpage.location=Localizacion:
   defaulterrorpage.notfound404=No se encuentra (404)
  -defaulterrorpage.rootcause=Causa Raiz:
  +defaulterrorpage.rootcause=Causa Raiz: 
   defaulterrorpage.documentmoved=Documento trasladado
   defaulterrorpage.thisdocumenthasmoved=Este Documento ha sido trasladado
  -defaulterrorpage.internalservleterror=Error interno del servlet:
  +defaulterrorpage.internalservleterror=Error interno del servlet: 
   
   tomcat.usage=uso: 
   tomcat.start=Iniciando tomcat. Comprueba el archivo logs/tomcat.log si hay errores
  
  
  

Mime
View raw message