Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 63442 invoked from network); 30 Sep 2004 13:56:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 30 Sep 2004 13:56:17 -0000 Received: (qmail 12464 invoked by uid 500); 30 Sep 2004 13:56:00 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 12391 invoked by uid 500); 30 Sep 2004 13:55:59 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 12378 invoked by uid 99); 30 Sep 2004 13:55:59 -0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=DNS_FROM_RFC_POST X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from [65.54.247.6] (HELO hotmail.com) (65.54.247.6) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 30 Sep 2004 06:55:59 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 30 Sep 2004 06:50:10 -0700 Received: from 206.66.2.100 by by2fd.bay2.hotmail.msn.com with HTTP; Thu, 30 Sep 2004 13:49:18 GMT X-Originating-IP: [206.66.2.100] X-Originating-Email: [commons101x@hotmail.com] X-Sender: commons101x@hotmail.com From: "struts commons" To: commons-user@jakarta.apache.org Bcc: Subject: new (custom) validation Date: Thu, 30 Sep 2004 08:49:18 -0500 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 30 Sep 2004 13:50:10.0459 (UTC) FILETIME=[67109EB0:01C4A6F4] X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello all, I hope this question is not to remedial but I am really trying to understand what's wrong here. I am trying to create a new validator for 'time'. I am basically parsing the string down to test components that make up the user input. I have followed numerous examples from books and internet to come up with the code below. My new class seems to be the problem as I can get the client side to function and return a valid boolean but it will not give me the resource message either client side or server side. I am able to put alert message in my javascript and get those but it will not return with the .properties message I wrote. All other validation (date, required, etc.. etc..) works fine both client and server. I included the code (minus the logic, I'm sure that is works) where I thought the problem may lie, but I'm new to Struts and fairly new to Java so if you need more I would be more than happy to oblige(just tell me what would help) but the rest of it seemed fairly standard and not where the problem may be. Thanks in advance. Jim /************************************************************ new class I created package com.gli.validator; import java.io.Serializable; import javax.servlet.http.HttpServletRequest; import org.apache.commons.validator.Field; import org.apache.commons.validator.ValidatorAction; import org.apache.struts.action.ActionErrors; import org.apache.commons.validator.GenericValidator; import org.apache.commons.validator.ValidatorUtil; import org.apache.struts.util.StrutsValidatorUtil; public class GLIValidator implements Serializable { /** * **/ public GLIValidator(){ } public static boolean validateTime(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { //processing to validate (left out to shorten email but it works) // ValidatorUtil.getValueAsString(bean, field.getProperty() ) // // return bValid; } } ***************************************************************/ /************************************************************** relevant portion of validator-rules.xml /************************************************************** /************************************************************** relevant portion of validation.xml
datePatternStrict MM/dd/yyyy ***************************************************************/ _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org