Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 45873 invoked from network); 23 Nov 2006 03:17:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Nov 2006 03:17:25 -0000 Received: (qmail 66017 invoked by uid 500); 23 Nov 2006 03:17:34 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 65470 invoked by uid 500); 23 Nov 2006 03:17:32 -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 65459 invoked by uid 99); 23 Nov 2006 03:17:32 -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 19:17:32 -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 19:17:22 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09B597142C1 for ; Wed, 22 Nov 2006 19:17:02 -0800 (PST) Message-ID: <788390.1164251822036.JavaMail.jira@brutus> Date: Wed, 22 Nov 2006 19:17:02 -0800 (PST) From: "Craig McClanahan (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Created: (VALIDATOR-209) Additional constructor for ValidatorResources that takes URL[] instead of String[] MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Additional constructor for ValidatorResources that takes URL[] instead of String[] ---------------------------------------------------------------------------------- Key: VALIDATOR-209 URL: http://issues.apache.org/jira/browse/VALIDATOR-209 Project: Commons Validator Issue Type: Improvement Components: Framework Affects Versions: 1.3.0 Release Reporter: Craig McClanahan Priority: Minor Currently, the constructor for ValidatorResources takes an InputStream, and array of InputStream, a single String, or an array of Strings (in the latter two cases, the strings are assumed to be URIs of either webapp resources or classpath resources to be parsed). In a web application environment, a framework or application using Commons Validator will typically use either ServletContext.getResource() or Class.getResource() to find URLs of the set of resources to be configured. However, the CommonsValidator constructor cannot take URLs correctly. Therefore, the caller will need to convert these URLs to external (String) form in order to pass them in. However, these Strings will ultimately need to be turned back into URLs anyway (inside the Digester instance being used), in order for relative references to work. Thus, the current implementation assumes that there is a lossless conversion from a URL returned by ServletContext.getResource() or Class.getResource(), to a String, and then back to a URL. That assumption is *not* necessarily guaranteed for the servlet context resources (although it is generally the case in practice for most containers). It is legal for the container to embed information (such as a custom URLStreamHandler implementation) inside the URLs it returns for webapp resources. It would be better defensive coding for ValidatorResources to accept an array of URLs of the resources to be loaded (and pass them directly in to Digester unchanged), in addition to the other constructors that are currently supported. -- 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