Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 60765 invoked from network); 1 Sep 2004 20:22:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 20:22:01 -0000 Received: (qmail 99745 invoked by uid 500); 1 Sep 2004 20:21:38 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 99683 invoked by uid 500); 1 Sep 2004 20:21:37 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 99669 invoked by uid 99); 1 Sep 2004 20:21:37 -0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_NJABL_PROXY,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from [207.217.120.149] (HELO asmtp-a063f33.pas.sa.earthlink.net) (207.217.120.149) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 01 Sep 2004 13:21:37 -0700 Received: from pool-151-199-40-129.bos.east.verizon.net ([151.199.40.129] helo=friedman) by asmtp-a063f33.pas.sa.earthlink.net with asmtp (Exim 4.34) id 1C2bbr-0001aD-1W for user@struts.apache.org; Wed, 01 Sep 2004 13:21:35 -0700 From: "David Friedman" To: "Struts Users Mailing List" Subject: RE: form validation (How to setup commons-logging to debug) Date: Wed, 1 Sep 2004 16:22:37 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <41CDC65E51EBD31187600050DA75099809780C18@EXCH01> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-ELNK-Trace: b135f2a34802a90f6f36dc87813833b2c01dc372911c85ad7e97a657334cfcd93e45ee93196a29bb350badd9bab72f9c350badd9bab72f9c350badd9bab72f9c X-Originating-IP: 151.199.40.129 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I haven't done this (manually - I've been copying my blank setup) in a while, but the basic steps are: a) Make sure you have a commons-logging jar in WEB-INF/lib I use commons-logging-1.0.3.jar (Struts v1.1) [Note: there is now a 1.0.4 version at http://jakarta.apache.org/commons b) Create the file for commons-logging.properties file in WEB-INF/classes and specify a logging service. I use the included SimpleLog though some people prefer log4j. My commons-logging.properties file is: org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog org.apache.commons.logging.simplelog.defaultlog=debug org.apache.commons.logging.simplelog.showlogname=true org.apache.commons.logging.simplelog.showdatetime=true c) Create the properties file for the service you are using. I use SimpleLog so I setup the file WEB-INF/classes/simplelog.properties with contents following one of these two patterns: org.apache.commons.logging.simplelog.log.SOMECLASS=LEVEL org.apache.commons.logging.simplelog.log.SOMEPACKAGE=LEVEL The available levels are described at: http://jakarta.apache.org/commons/logging/commons-logging-1.0.3/docs/api/org /apache/commons/logging/Log.html, trace (the least serious) debug info warn error fatal (the most serious) none (I use this to turn of logging for a class or package) If you want all packages under the package com.leung.struts to log debug information, you can include the line: org.apache.commons.logging.simplelog.log.com.leung.struts=debug If you want only the package com.leung.struts.actions.ExampleAction to trace every possible action, you could include the line: org.apache.commons.logging.simplelog.log.com.leung.actions.ExampleAction=tra ce If you want all validation information messages, you could include the line: org.apache.commons.logging.simplelog.log.org.apache.struts.validator=info d) Add the appropriate log lines in your Action subclass to there is something to read in the logs. d.1) The class must define a logging facility such as: private Log log = LogFactory.getLog(this.getClass()); d.2) The class must use log.debug(), log.trace(), log.warn(), log.error(), etc. as appropriate. Some people prefer to use the log.isDebug() method before deciding to invoke log.debug(String someTextStatusMessage) or the appropriate log.isWHATEVER() for the other logging levels. REMEMBER! If you don't put debug statements in the code, the logging facility won't have anything to show you. Also, I believe that if you have a log level of "info" all less serious levels, in this case "debug" should show up in your log file. I hope this helps. Regards, David -----Original Message----- From: Leung, Albert [mailto:ALeung@Biscom.com] Sent: Wednesday, September 01, 2004 3:41 PM To: Struts Users Mailing List Subject: RE: form validation David, I've checked everything thoroughly. I've eliminated spelling errors and missing references. It would be a great help if you could show me how to turn on debugging and commons logging. Regards, Albert -----Original Message----- From: David Friedman [mailto:humble@ix.netcom.com] Sent: Wednesday, September 01, 2004 3:35 PM To: Struts Users Mailing List Subject: RE: form validation Albert, When all that is correctly setup, I've only ever had problems with a misspelled forward inside my action or missing JSP/html/other pages. I've had a blank page show up when the forward was "intup" and I meant "input". Have you checked the code in your action? Have you turned on the logging features or commons logging for further details even up to the debug level? Regards, David -----Original Message----- From: Leung, Albert [mailto:ALeung@Biscom.com] Sent: Wednesday, September 01, 2004 3:26 PM To: Struts Users Mailing List Subject: RE: form validation It definitely exists. The action definition, the input forms, form beans definition, validation entries are exactly the same in both projects. -----Original Message----- From: Bill Siggelkow [mailto:billsigg@bellsouth.net] Sent: Wednesday, September 01, 2004 3:14 PM To: user@struts.apache.org Subject: Re: form validation Leung, Albert wrote: > For some reason I can't get form validation to work for a particular > project. If I take the same ValidatorForm, use the same validation entry in > formset, and update the struts-config to use the same form bean and action > it works fine in another project. The project that has problems just gives > me a blank page whenever it finds something wrong. There is no stack trace > or log that can tell me what could be wrong. > > > > Please help! > > > > Albert > > This can happen if the page specified by the "input" attribute does not exist. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org