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 Thu, 28 Sep 2000 02:07:09 GMT
larryi      00/09/27 19:07:08

  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:
  Update default response handling to optionally show the offending request.
  
  Renamed ContextManager's showStackTraces attribute to showDebugInfo
  and use it to control showing the offending requests as well as stack traces.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.29.2.6  +10 -5     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.5
  retrieving revision 1.29.2.6
  diff -u -r1.29.2.5 -r1.29.2.6
  --- server.xml	2000/09/22 04:07:13	1.29.2.5
  +++ server.xml	2000/09/28 02:07:01	1.29.2.6
  @@ -89,12 +89,17 @@
            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.
  +         You can specify the "showDebugInfo" attribute to control whether
  +         debugging information is displayed in Tomcat's default responses.
  +         This debugging information includes:
  +             1. Stack traces for exceptions
  +             2. Request URI's that cause status codes >= 400
  +         The default is "true", so you must specify "false" to prevent
  +         the debug information from appearing.  Since the debugging
  +         information reveals internal details about what Tomcat is serving,
  +         set showDebugInfo="false" if you wish increased security.
         -->
  -    <ContextManager debug="0" workDir="work" showStackTraces="true" >
  +    <ContextManager debug="0" workDir="work" showDebugInfo="true" >
   
         <!-- ==================== Interceptors ==================== -->
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.45.2.6  +44 -9     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.5
  retrieving revision 1.45.2.6
  diff -u -r1.45.2.5 -r1.45.2.6
  --- DefaultCMSetter.java	2000/09/22 04:07:14	1.45.2.5
  +++ DefaultCMSetter.java	2000/09/28 02:07:03	1.45.2.6
  @@ -166,9 +166,24 @@
   	    .append("</title></head>\r\n");
   	buf.append("<body><h1>")
   	    .append(sm.getString("defaulterrorpage.notfound404"))
  -	    .append("</h1>\r\n");
  +	    .append("</h1>\r\n<b>");
   	buf.append(sm.getString("defaulterrorpage.originalrequest"))
  +	    .append("</b> ")
   	    .append( requestURI );
  +
  +	if (contextM.getShowDebugInfo()) {
  +	    if (res.isIncluded()) {
  +		requestURI = (String)req.
  +		    getAttribute("javax.servlet.include.request_uri");
  +	    }
  +	    if (requestURI != null) {
  +		buf.append("<br><br>\r\n<b>")
  +		    .append(sm.getString("defaulterrorpage.notfoundrequest"))
  +		    .append("</b> ")
  +		    .append( requestURI );
  +	    }
  +	}
  +
   	buf.append("</body>\r\n");
   
   	String body = buf.toString();
  @@ -228,13 +243,23 @@
   	// More info - where it happended"
   	buf.append("<h2>")
   	    .append(sm.getString("defaulterrorpage.location"))
  +	    .append(" ")
   	    .append(req.getRequestURI())
   	    .append("</h2>");
   
  +	if ( res.isIncluded() && contextM.getShowDebugInfo()) {
  +	    buf.append("\r\n<h2>")
  +		.append(sm.getString("defaulterrorpage.errorlocation"))
  +		.append(" ")
  +		.append((String)req.
  +			getAttribute("javax.servlet.include.request_uri"))
  +		.append("</h2>");
  +	}
  +
   	buf.append("<b>")
   	    .append(sm.getString("defaulterrorpage.internalservleterror"));
   
  -	if (contextM.getShowStackTraces()) {
  +	if (contextM.getShowDebugInfo()) {
   	    buf.append("</b><br>");
   
   	    buf.append("<pre>");
  @@ -247,9 +272,9 @@
   
   	    buf.append("</pre>\r\n");
   	} else {
  -	    buf.append("</b>")
  +	    buf.append("</b> ")
       	        .append(e.getMessage())
  -		.append("<br>\r\n");
  +		.append("<br><br>\r\n");
   	}
   
           if (e instanceof ServletException) {
  @@ -258,7 +283,7 @@
   		buf.append("<b>")
   		    .append(sm.getString("defaulterrorpage.rootcause"));
   
  -		if (contextM.getShowStackTraces()) {
  +		if (contextM.getShowDebugInfo()) {
   		    buf.append("</b>\r\n");
   
   		    buf.append("<pre>");
  @@ -270,9 +295,8 @@
   
   		    buf.append("</pre>\r\n");
   		} else {
  -		    buf.append("</b>")
  -			.append(cause.getMessage())
  -			.append("\r\n");
  +		    buf.append("</b> ")
  +			.append(cause.getMessage());
   		}
   	    }
   	}
  @@ -326,7 +350,8 @@
   
   	buf.append("<h1>");
   	if( res.isIncluded() ) {
  -	    buf.append(sm.getString("defaulterrorpage.includedservlet") );
  +	    buf.append(sm.getString("defaulterrorpage.includedservlet") )
  +		.append(" ");
   	}  else {
   	    buf.append("Error: ");
   	}
  @@ -337,8 +362,18 @@
   	// More info - where it happended"
   	buf.append("<h2>")
   	    .append(sm.getString("defaulterrorpage.location"))
  +	    .append(" ")
   	    .append(req.getRequestURI())
   	    .append("</h2>");
  +
  +	if ( sc >= 400 && res.isIncluded() && contextM.getShowDebugInfo())
{
  +	    buf.append("\r\n<h2>")
  +		.append(sm.getString("defaulterrorpage.errorlocation"))
  +		.append(" ")
  +		.append((String)req.
  +			getAttribute("javax.servlet.include.request_uri"))
  +		.append("</h2>");
  +	}
   
   	buf.append("<b>")
   	    .append(msg)
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.100.2.10 +9 -9      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.9
  retrieving revision 1.100.2.10
  diff -u -r1.100.2.9 -r1.100.2.10
  --- ContextManager.java	2000/09/22 04:07:15	1.100.2.9
  +++ ContextManager.java	2000/09/28 02:07:05	1.100.2.10
  @@ -171,7 +171,7 @@
       /** The setting which controls display of stack traces
        *  in the default exception handling
        */
  -    boolean showStackTraces = true;
  +    boolean showDebugInfo = true;
       
       /** Default work dir, relative to home
        */
  @@ -331,18 +331,18 @@
           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.
  +    /** Get the showDebugInfo property to be used for controlling the display of
  +     *  debugging information in default responses.
        **/
  -    public boolean getShowStackTraces() {
  -	return showStackTraces;
  +    public boolean getShowDebugInfo() {
  +	return showDebugInfo;
       }
       
  -    /** Sets the showStackTraces property used for controlling the display of
  -     *  stack traces in the default response for exceptions.
  +    /** Sets the showDebugInfo property used for controlling the display of
  +     *  debugging information in default responses.
        */
  -    public void setShowStackTraces(boolean showStackTraces) {
  -	this.showStackTraces = showStackTraces;
  +    public void setShowDebugInfo(boolean showDebugInfo) {
  +	this.showDebugInfo = showDebugInfo;
       }
   	
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.2   +6 -4      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.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- LocalStrings.properties	2000/09/22 04:07:16	1.4.2.1
  +++ LocalStrings.properties	2000/09/28 02:07:06	1.4.2.2
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings.properties,v 1.4.2.1 2000/09/22 04:07:16 larryi Exp $
  +# $Id: LocalStrings.properties,v 1.4.2.2 2000/09/28 02:07:06 larryi Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -11,14 +11,16 @@
   defaultservlet.files=Files:
   
   #DefaultCMSetter / error handlers
  -defaulterrorpage.originalrequest=Original request
  +defaulterrorpage.originalrequest=Original request:
   defaulterrorpage.includedservlet=Included servlet error:
   defaulterrorpage.location=Location:
  +defaulterrorpage.errorlocation=Error 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:
  +defaulterrorpage.notfoundrequest=Not found request:
   
   #Tomcat.java
   tomcat.usage=usage: 
  
  
  
  1.1.2.4   +5 -3      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.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- LocalStrings_en.properties	2000/09/22 04:07:17	1.1.2.3
  +++ LocalStrings_en.properties	2000/09/28 02:07:07	1.1.2.4
  @@ -11,14 +11,16 @@
   defaultservlet.files=Files:
   
   #DefaultCMSetter / error handlers
  -defaulterrorpage.originalrequest=Original request
  +defaulterrorpage.originalrequest=Original request:
   defaulterrorpage.includedservlet=Included servlet error:
   defaulterrorpage.location=Location:
  +defaulterrorpage.errorlocation=Error 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:
  +defaulterrorpage.notfoundrequest=Not found request:
   
   #Tomcat.java
   tomcat.usage=usage: 
  
  
  
  1.4.2.2   +5 -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.2.1
  retrieving revision 1.4.2.2
  diff -u -r1.4.2.1 -r1.4.2.2
  --- LocalStrings_es.properties	2000/09/22 04:07:19	1.4.2.1
  +++ LocalStrings_es.properties	2000/09/28 02:07:07	1.4.2.2
  @@ -1,4 +1,4 @@
  -# $Id: LocalStrings_es.properties,v 1.4.2.1 2000/09/22 04:07:19 larryi Exp $
  +# $Id: LocalStrings_es.properties,v 1.4.2.2 2000/09/28 02:07:07 larryi Exp $
   #
   
   # Localized strings for package org.apache.tomcat.core
  @@ -13,11 +13,13 @@
   defaulterrorpage.originalrequest=Request original:
   defaulterrorpage.Includedservlet=Error en el Servlet Incluido:
   defaulterrorpage.location=Localizacion:
  +defaulterrorpage.errorlocation=Localizacion del error:
   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:
  +defaulterrorpage.notfoundrequest=No se ha encontrado el request:
   
   tomcat.usage=uso: 
   tomcat.start=Iniciando tomcat. Comprueba el archivo logs/tomcat.log si hay errores
  
  
  

Mime
View raw message