dgraham 2003/07/01 20:03:55 Modified: src/share/org/apache/struts/tiles ActionComponentServlet.java src/share/org/apache/struts/upload DiskMultipartRequestHandler.java src/share/org/apache/struts/action ActionServlet.java ActionServletWrapper.java src/share/org/apache/struts/validator ValidatorForm.java DynaValidatorForm.java Log: Removed deprecated ActionServlet debug level and logging methods. Revision Changes Path 1.10 +11 -11 jakarta-struts/src/share/org/apache/struts/tiles/ActionComponentServlet.java Index: ActionComponentServlet.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/tiles/ActionComponentServlet.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ActionComponentServlet.java 18 Mar 2003 02:25:11 -0000 1.9 +++ ActionComponentServlet.java 2 Jul 2003 03:03:55 -0000 1.10 @@ -211,13 +211,13 @@ if (formInstance == null) return (true); - if (debug >= 1) - log(" Validating input form properties"); + + log(" Validating input form properties"); // Was this submit cancelled? if ((request.getParameter(Constants.CANCEL_PROPERTY) != null) || (request.getParameter(Constants.CANCEL_PROPERTY_X) != null)) { - if (debug >= 1) + log(" Cancelled transaction, no validation"); return (true); } @@ -231,7 +231,7 @@ // backward compatibility. ActionErrors errors = formInstance.validate(mapping, request); if ((errors == null) || errors.empty()) { // - if (debug >= 1) + log(" No errors detected, accepting input"); return (true); } @@ -239,9 +239,9 @@ //does our form have a multipart request? if (formInstance.getMultipartRequestHandler() != null) { //rollback the request - if (debug > 1) { + log(" Rolling back the multipart request"); - } + formInstance.getMultipartRequestHandler().rollback(); } @@ -249,7 +249,7 @@ // Has an input form been specified for this mapping? String uri = mapping.getInput(); if (uri == null) { - if (debug >= 1) + log(" No input form, but validation returned errors"); response.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR, @@ -258,7 +258,7 @@ } // Save our error messages and return to the input form if possible - if (debug >= 1) + log(" Validation error(s), redirecting to: " + uri); request.setAttribute(Globals.ERROR_KEY, errors); doForward(uri, request, response); 1.23 +7 -8 jakarta-struts/src/share/org/apache/struts/upload/DiskMultipartRequestHandler.java Index: DiskMultipartRequestHandler.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/upload/DiskMultipartRequestHandler.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- DiskMultipartRequestHandler.java 21 Apr 2003 02:28:20 -0000 1.22 +++ DiskMultipartRequestHandler.java 2 Jul 2003 03:03:55 -0000 1.23 @@ -292,11 +292,10 @@ //default to system-wide tempdir tempDir = System.getProperty("java.io.tmpdir"); - if (getServlet().getDebug() > 1) { - log.debug("DiskMultipartRequestHandler.handleRequest(): " + - "defaulting to java.io.tmpdir directory \"" + - tempDir); - } + log.debug( + "DiskMultipartRequestHandler.handleRequest(): " + + "defaulting to java.io.tmpdir directory \"" + + tempDir); } } } 1.151 +4 -60 jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java Index: ActionServlet.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v retrieving revision 1.150 retrieving revision 1.151 diff -u -r1.150 -r1.151 --- ActionServlet.java 28 Jun 2003 06:16:34 -0000 1.150 +++ ActionServlet.java 2 Jul 2003 03:03:55 -0000 1.151 @@ -223,11 +223,6 @@ * servlet or JSP page. [text/html] * <em>DEPRECATED - Configure this using the "contentType" attribute * of the <controller> element.</em></li> - * <li><strong>debug</strong> - TThe debugging detail level that controls how much - * information is logged for this servlet. Accepts values 0 (off) and from - * 1 (least serious) through 6 (most serious). [0] - * <em>DEPRECATED - Configure the logging detail level in your - * underlying logging implementation.</em></li> * <li><strong>factory</strong> - The Java class name of the * <code>MessageResourcesFactory</code> used to create the application * <code>MessageResources</code> object. @@ -347,14 +342,6 @@ */ protected FastHashMap dataSources = new FastHashMap(); - - /** - * The debugging detail level for this servlet. - * @deprecated - */ - protected int debug = 0; - - /** * The resources object for our internal resources. */ @@ -629,20 +616,6 @@ } - - /** - * Return the debugging detail level for this servlet. - * - * @deprecated Configure the logging detail level in your underlying - * logging implementation - */ - public int getDebug() { - - return (this.debug); - - } - - /** * Return the <code>MessageResources</code> instance containing our * internal message strings. @@ -671,24 +644,6 @@ } - /** - * Log the specified message if the current debugging detail level for - * this servlet has been set to an equal or higher value. Otherwise, - * ignore this message. - * - * @param message Message to be logged - * @param level Debugging detail level of this message - * @deprecated Use commons-logging instead. - */ - public void log(String message, int level) { - - if (debug >= level) { - log(message); - } - - } - - // ------------------------------------------------------ Protected Methods @@ -1348,17 +1303,6 @@ value = getServletConfig().getInitParameter("config"); if (value != null) { config = value; - } - - value = getServletConfig().getInitParameter("debug"); - if (value != null) { - try { - debug = Integer.parseInt(value); - } catch (NumberFormatException e) { - // FIXME Why should we catch this? If the programmer has specified an - // invalid integer we should probably let this RuntimeException bubble up. - debug = 0; - } } // Backwards compatibility for form beans of Java wrapper classes 1.9 +4 -32 jakarta-struts/src/share/org/apache/struts/action/ActionServletWrapper.java Index: ActionServletWrapper.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServletWrapper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ActionServletWrapper.java 1 May 2003 16:16:49 -0000 1.8 +++ ActionServletWrapper.java 2 Jul 2003 03:03:55 -0000 1.9 @@ -78,38 +78,10 @@ */ public class ActionServletWrapper { - /** * The controller servlet instance to which we are attached. */ protected transient ActionServlet servlet = null; - - - - /** - * Log the specified message if the current debugging detail level for - * this servlet has been set to an equal or higher value. Otherwise, - * ignore this message. - * - * @param message Message to be logged - * @param level Debugging detail level of this message - * @deprecated Logging should now use the commons logging - */ - public void log(String message, int level) { - - servlet.log(message,level); - - } - - /** - * Log message. - * @param message - */ - public void log(String message) { - - servlet.log(message); - - } /** * Set servlet to a MultipartRequestHandler. 1.10 +6 -36 jakarta-struts/src/share/org/apache/struts/validator/ValidatorForm.java Index: ValidatorForm.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/ValidatorForm.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ValidatorForm.java 1 May 2003 17:47:55 -0000 1.9 +++ ValidatorForm.java 2 Jul 2003 03:03:55 -0000 1.10 @@ -7,7 +7,7 @@ * * The Apache Software License, Version 1.1 * - * Copyright (c) 1999 The Apache Software Foundation. All rights + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without @@ -61,8 +61,8 @@ package org.apache.struts.validator; import java.io.Serializable; - import java.util.Map; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; @@ -90,7 +90,6 @@ * @see org.apache.struts.action.ActionForm * @since Struts 1.1 */ - public class ValidatorForm extends ActionForm implements Serializable { /** @@ -155,35 +154,6 @@ } return errors; - } - - /** - * Convenience method that call the comparable servlet log method and writes - * an explanatory message and a stack trace for a given Throwable exception to the - * servlet log file. - * - * @param message String that describes the error or exception - * @deprecated Use common-logging to log debug messages. - */ - protected void log(String message) { - if (getServlet().getDebug() >= 1) { - getServlet().log(message); - } - } - - /** - * Convenience method that call the comparable servlet log method and writes - * an explanatory message and a stack trace for a given Throwable exception to the - * servlet log file. - * - * @param message String that describes the error or exception - * @param throwable Throwable error or exception - * @deprecated Use common-logging to log debug messages. - */ - protected void log(String message, Throwable throwable) { - if (getServlet().getDebug() >= 1) { - getServlet().log(message, throwable); - } } /** 1.10 +7 -34 jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorForm.java Index: DynaValidatorForm.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/validator/DynaValidatorForm.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DynaValidatorForm.java 1 May 2003 17:54:04 -0000 1.9 +++ DynaValidatorForm.java 2 Jul 2003 03:03:55 -0000 1.10 @@ -62,8 +62,10 @@ import java.io.Serializable; import java.util.Map; + import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; + import org.apache.commons.beanutils.DynaBean; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -71,8 +73,8 @@ import org.apache.commons.validator.ValidatorException; import org.apache.commons.validator.ValidatorResults; import org.apache.struts.action.ActionErrors; -import org.apache.struts.action.DynaActionForm; import org.apache.struts.action.ActionMapping; +import org.apache.struts.action.DynaActionForm; /** * <p>This class extends <strong>DynaActionForm</strong> and provides @@ -154,35 +156,6 @@ } return errors; - } - - /** - * Convenience method that call the comparable servlet log method and writes - * an explanatory message and a stack trace for a given Throwable exception to the - * servlet log file. - * - * @param message String that describes the error or exception - * @deprecated Use common-logging, or other logging implementation to log debug messages. - */ - protected void log(String message) { - if (getServlet().getDebug() >= 1) { - getServlet().log(message); - } - } - - /** - * Convenience method that call the comparable servlet log method and writes - * an explanatory message and a stack trace for a given Throwable exception to the - * servlet log file. - * - * @param message String that describes the error or exception - * @param throwable Throwable error or exception - * @deprecated Use common-logging, or other logging implementation to log debug messages. - */ - protected void log(String message, Throwable throwable) { - if (getServlet().getDebug() >= 1) { - getServlet().log(message, throwable); - } } /**
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]