RE: struts validator
"Louis Moore" <[email protected]> Mon, 7 Jun 2004 12:45:03 -0700
| Newsgroups | gmane.comp.java.keel.user |
|---|---|
| Message-ID | <C5E6D04B7C014946B7CCBFC2AF30DB620155AC8D@corpmail01.corp.walmart.com> |
Thanks -- so I got started working with the DefaultModelValidator,
here's the metadata for a model I have using it:
@model.model
name="testeng.getcase"
id="testeng.getcase"
logger="testeng"
@model.parameter
name="caseid"
required="true"
type="java.lang.String"
pattern="CASE[0-9]{8}"
@model.validation-error
model="testeng.prompt-getcase"
params="true"
And I got it to work but I found a couple of bugs along the way. (These
are in both 2.1-dev and CVS HEAD):
1) The redirect to the validation-error model code is always executed.
(meaning even if your input is valid you get redirected)
2) But if validation-error params=false, the redirect command is not
returned. (meaning if you have params=false the redirect never happens
at all)
I was able to fix both of these in my code and it's working fine. I'd be
happy to submit a patch if you want. The only problem I'm still having
is the errors aren't being displayed after redirect when the pattern
wasn't matched (using the keel:errors tag). I'd appreciate any ideas on
that.
Regards,
Lou
-----Original Message-----
From: Michael Nash JGlobal.com [mailto:[email protected]]
Sent: Saturday, June 05, 2004 11:05 AM
To: user-6VIttnCrOeJXNEnpj1eHPNi2O/[email protected]
Cc: Louis Moore
Subject: Re: [Keel User] struts validator
Lou:
Just wanted to let you know there's now a start on documentation for the
Validation service. Have a look at the Keel manual (HEAD version), in
the "Default Model Service" chapter. It needs more, but I think there's
enough to get the general idea!
Mike
On Thu, 3 Jun 2004 10:51:44 -0700
"Louis Moore" <[email protected]> wrote:
> Hi,
>
> Is there any documentation or examples of how to use the struts
> validator framework within keel? Since Keel has only one action
mapping
> and form-bean for the model action it seems like maybe the validator
> framework isn't a viable option unless I abandon the use of models and
> write my own struts actions. Is this the case or is there a way to
> configure the validator to work with keel models?
>
> If the struts validator plug-in isn't supported well within keel I'm
> considering creating a keel validation service with the
turbine-fulcrum
> project's intake service.
>
> Thanks,
> Lou
> _______________________________________________
> User mailing list
> [email protected]
> http://lists.keelframework.org/listinfo.cgi/user-keelframework.org
--
Michael Nash
JGlobal Ltd
Next-Generation Web Application Development and Open Source Support
http://www.jglobal.com
Bahamas Commerce and Trade
Offshore eCommerce Hosting and Business Services
http://www.bahamascommerce.com