Return-Path: Delivered-To: apmail-jakarta-struts-dev-archive@jakarta.apache.org Received: (qmail 78461 invoked by uid 500); 7 Jul 2001 05:31:20 -0000 Mailing-List: contact struts-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: struts-dev@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list struts-dev@jakarta.apache.org Received: (qmail 78449 invoked by uid 500); 7 Jul 2001 05:31:19 -0000 Delivered-To: apmail-jakarta-struts-cvs@apache.org Received: (qmail 78444 invoked by uid 1345); 7 Jul 2001 05:31:19 -0000 Date: 7 Jul 2001 05:31:19 -0000 Message-ID: <20010707053119.78443.qmail@apache.org> From: dwinterfeldt@apache.org To: jakarta-struts-cvs@apache.org Subject: cvs commit: jakarta-struts/contrib/validator INSTALL LICENSE README build.xml build.properties build-test.xml dwinterfeldt 01/07/06 22:31:18 Added: contrib/validator INSTALL LICENSE README build.xml build.properties build-test.xml Log: Adding Struts Validator to cvs. Revision Changes Path 1.1 jakarta-struts/contrib/validator/INSTALL Index: INSTALL =================================================================== Struts Validator ================== The Struts Validator Jar (dist/Struts_Validator-{date}.jar) and version 1.2 of the Jakarta Regular Expression Package (http://jakarta.apache.org/regexp) needs to be added to /WEB-INF/lib. This needs to be added to the web.xml file to load the ValidatorServlet. validator com.wintecinc.struts.action.ValidatorServlet config /WEB-INF/validation.xml debug 2 2 Add the error messages to your ApplicationResources.properties file for the pluggable validators that you are using in your project. Make sure that you have errors.header & errors.footer in it if you are going to use the Struts' html:errors tag. If you use the Validator errors tag then the header and the footer are optional and configurable as to what message resource key is used to create the header and the footer. The message resource key a pluggable validator uses to create an error message is configurable in the validation.xml file by modifying the pluggable validator's msg attribute. Example Error Messages: errors.required=
  • {0} is required.
  • errors.invalid=
  • {0} is invalid.
  • Copy the validators that you want to use from the validation.xml file in /web/example/WEB-INF or make your own. 1.1 jakarta-struts/contrib/validator/LICENSE Index: LICENSE =================================================================== /* * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2001 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, if * any, must include the following acknowlegement: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowlegement may appear in the software itself, * if and wherever such third-party acknowlegements normally appear. * * 4. The names "The Jakarta Project", "Struts", and "Apache Software * Foundation" must not be used to endorse or promote products derived * from this software without prior written permission. For written * permission, please contact apache@apache.org. * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * . * */ 1.1 jakarta-struts/contrib/validator/README Index: README =================================================================== Struts Validator ================== You must do the following to have the build script work. 1. Edit the build.properties file. 2. Add the follwing to the lib directory. Struts - struts.jar (http://jakarta.apache.org/struts/) Jakarata Regexp - jakarta-regexp.jar (http://jakarta.apache.org/regexp/) JDBC 2.0 Optonal Package - jdbc2_0-stdext.jar (http://java.sun.com/products/jdbc/download.html#spec) 3. Place the following Struts tlds from the Struts download in 'struts/WEB-INF/tlds'. (struts-bean.tld struts-html.tld struts-logic.tld struts-template.tld) Overview --------- The Validation Framework was made to work with Struts. It can perform basic validations to check if a field is required, matches a regular expression, email, credit card, and server side type checking and date validation. Different validation rules can be defined for different locales. The framework has basic support for user defined constants which can be used in some field attributes. The validation routines are modifiable in the validation.xml file so custom validation routines can be created and added to the framework. 1.1 jakarta-struts/contrib/validator/build.xml Index: build.xml =================================================================== 1.1 jakarta-struts/contrib/validator/build.properties Index: build.properties =================================================================== # Properties related to the user's environment. This file should be provided # for building the Cactus Sample or the properties need to be specified on # the command line when starting Ant with the -D switch java.home=d:/jdk1.3 servlet.jar=e:/tomcat3/lib/servlet.jar cactus.jar=e:/software/cactus/lib/commons-cactus.jar cactus.ant.jar=e:/software/cactus/lib/commons-cactus-ant.jar junit.jar=e:/software/junit3.5/junit.jar struts.jar=lib/struts_1_0.jar # Shouldn't be necessary, there is a problem with my ant setup ant.jar=e:/software/ant/lib/ant.jar ant.optional.jar=e:/software/ant/lib/optional.jar # Servlet engine locations for the tests # Note: If you don't want to run the test on a given servlet engine, just # comment it's home property. For example, if you don't want to run the # tests on the Resin 1.3, comment the "resin.home.13" property. #resin.home.13 = f:/applis/resin-1.3.s010125 tomcat.home.32 = e:/tomcat3 tomcat.home.40 = e:/tomcat 1.1 jakarta-struts/contrib/validator/build-test.xml Index: build-test.xml ===================================================================