struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Iñigo Serrano <inigon...@wanadoo.es>
Subject Re: [ANN] Routines to validate Data in Struts
Date Thu, 29 Nov 2001 05:15:11 GMT
Hello,

I don´t know if it is a validator in the commons, but the Struts version 1.1
have one.

The ISValidator was originaly developed to work in diferents scenarios. I
was searching routines to validate data but the routines that I found were
focused in form validation.

I thought: Why I can´t use the same routines to validate data from the
command line, or from servlets, or from... ? they are allways a String !

So I began developing ISValidator. It can be used to Model, Validate and
Process data.

I am translating the web to English but it takes time, so I am going to tell
you the filosophi of it.

Let´s thing in struts example

We have some parameters of the form (data) that have to match some
constraints, in this case to be not blank.

In ISValidator one data is modeled with a ConstraintContainer, the
constraints that have to match are modeled with Constraints and the group of
all the data (all the form) with MetaContainers (Constainers of Containers)

We can choose diferents MetaContainer, in this example we use the
SimpleMetaContainer (it is the simplest), but we have also
CommandLineMetaContainer (to work with data form the command line) and
ServletParameterMetaContainer (to work with servlets parameters)

Each data is modeled in this case with SimpleConstraintContainer (the reason
is the same , it is the simplest) but we also have
CommandLineArgumentConstraintContainer (one argument from the command line)
and ServletParameterConstraintContainer (one parameter form the servlets
request)

The diferents metacontainers and constraintContainers are expecializated
versions of the Simples to be more easy to use.

The Constraints checks one data to fit one restriction. One data can have
one or more constraints, and one instance of a constraint can only be in one
container.

When some data dosen´t fit one restriction then we need to know why (what
data, what constraint and why dosen´t fit) this information are processed
with InValidConstraintProcessor (one instance for each Constraint) and
stored using InValidConstraintProcessorContainers. In this example we use a
Processor and a ProcessorContainer expecificaly for Struts to create the
ActionErrors.

I am not a member of the Struts group. I don´t know the validator that you
say, but one thing it is clear, if you like ISValidator, use it, if no,
thank for your interest.

Thanks

Iñigo
---------------------------------------
http://www.inigoserrano.com

----- Original Message -----
From: "juraj Lenharcik" <juraj.lenharcik@datainput.de>
To: "'Struts Users Mailing List'" <struts-user@jakarta.apache.org>
Sent: Thursday, November 29, 2001 1:33 PM
Subject: AW: [ANN] Routines to validate Date in Struts


> Hello,
>
> is there not already a validator present in the commons? /1 can yo explain
> what the essentials differences are? perhaps a documentation of the
> abilities. your side is not so meaningful for a non spanish speaker. ;-)
>
>
> thanks
>
> 1- http://home.earthlink.net/~dwinterfeldt/
>
>
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Iñigo Serrano [mailto:inigonews@wanadoo.es]
> Gesendet: Dienstag, 27. November 2001 03:01
> An: Struts User
> Betreff: [ANN] Routines to validate Date in Struts
>
>
> Hello
>
> I am developing a routines (ISValidator) to validate data in diferents
> scenarios, command line argumets, Servlets Parameters, etc,...
>
> I have develop also some classes to use ISValidator in Struts 1.0
>
> With this routines the process of validating a form is more easy and
> sistematic i think.
>
> I have modified the example LogonForm to work with IsValidator.
>
> The example is in
>
http://www.inigoserrano.com/ISValidator/en/ejemploStrutsCompleto0010ISValida
> tor.htm
>
> The routines and this page are in English but the rest of the web is in
> spanish (I am translating it to English). To download the routines just go
> to the download option in the menu and acept the license, you have the
> option to download in zip and in tar.gz
>
> The routines are licensed under the GNU GPL 2
>
> I hope it can be usefull for somebody
>
> Iñigo
> ---------------------------------------------------------
> http://www.inigoserrano.com
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message