Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 96995 invoked from network); 22 Nov 2006 23:57:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 23:57:26 -0000 Received: (qmail 6076 invoked by uid 500); 22 Nov 2006 23:57:34 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 6057 invoked by uid 500); 22 Nov 2006 23:57:34 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 6046 invoked by uid 99); 22 Nov 2006 23:57:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 15:57:34 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 15:57:24 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 042DC7142C3 for ; Wed, 22 Nov 2006 15:57:04 -0800 (PST) Message-ID: <2478315.1164239824014.JavaMail.jira@brutus> Date: Wed, 22 Nov 2006 15:57:04 -0800 (PST) From: "Niall Pemberton (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Resolved: (VALIDATOR-195) Lodaing of Digester Rules for classes extending ValidatorResources does not work In-Reply-To: <22213856.1151505390950.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/VALIDATOR-195?page=all ] Niall Pemberton resolved VALIDATOR-195. --------------------------------------- Fix Version/s: 1.3.1 Resolution: Fixed Assignee: Niall Pemberton Changing ValidatorResources to always load the digester rules from the "org.apache.commons.validator" package could break behaviour for someone relying on this (i.e. if they're plugging in their own custom Digester rules) - so I don't want to make the change you requested. I have however modified ValidatorResources to use the digester rules in the "org.apache.commons.validator" package if no rules are found in the default package for the class - this should resolve your issue and retain backwards compatibility: http://svn.apache.org/viewvc?view=rev&revision=478392 Thanks for reporting this Niall > Lodaing of Digester Rules for classes extending ValidatorResources does not work > --------------------------------------------------------------------------------- > > Key: VALIDATOR-195 > URL: http://issues.apache.org/jira/browse/VALIDATOR-195 > Project: Commons Validator > Issue Type: Bug > Components: Framework > Affects Versions: 1.3.0 Release, 1.2.0 Release > Environment: Windows/Unix > Reporter: Vijay Pandey > Assigned To: Niall Pemberton > Fix For: 1.3.1 > > > If we extend the class "ValidatorResources", then the loading of the digester rules does not work properly. > ---------------------------------ValidatorResources--------------------------------------------------------- > private Digester initDigester() { > URL rulesUrl = this.getClass().getResource("digester-rules.xml"); > ----------------------------------------------------------------------------------------------------------------------- > The above line tries to find the "digester-rules.xml" from the path of extending class and hence to make this work we need to > copy the digester rules xml file in the same pacakge as the extending class. > I think a better way might be is to accept a InputStream or URL for the digester rules in the constructor if someone wants to > have their custom digester rules, and by default if it's not provided it should always take from the ValidatorResources path > by changing the code > this.getClass().getResource("digester-rules.xml"); > to > ValidatorResources.class.getResource("digester-rules.xml"); > Thanks > Vijay > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org