You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Matthias Wessendorf <ma...@matthias-wessendorf.de> on 2004/07/14 13:25:02 UTC

getValidationKey()

Hi,

just looked at DynaValidatorForm & DynaValidatorActionForm 
saw, DynaValidatorActionForm has no validate() more but

getValidationKey() that returns the path...
it is the overwritten method from DynaValidatorForm

sawing also, that getValidationKey() gets trigered
in DynaValidatorForm.validate()

the same for ValidatorActionForm.java

now my question, why is getValidationKey() public ?
and not protected ?

is this method in any other use?
(i didn't found one...)

Cheers,

Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
Email: matthias AT wessendorf DOT net
URL: http://www.wessendorf.net


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: getValidationKey()

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
No its not used anywhere else at this point.

I think this was a mistake when I originally coded the patch but I did have
the thought that maybe it could be used in the future with generating the
client side validations.  Not having to specify the form name on the
<html:javascript> tag would be good, especially if you implement some more
complex logic for determining the validation key - maybe for example for one
of the flavours of the dispatch actions.

To call this method you obviously need three things: the ValidatorForm,
ActionMapping and Request. The <html:form> tag already gets hold of the
ActionMapping (it just needs a small change to expose it) and instantiates a
copy of the ActionForm if it doesn't exist, so for the current validator
form implementations (which only need the getValidationKey() method and the
mapping) this would work.

Where it would fall down is when someone implements a strategy that uses
either something in the Request or the populated contents of the ActionForm
in order to determine the validation key because they are obviously not in
the same state when the html page is rendered as they are when the form is
posted back and the RequestProcessor calls the validate method. I guess for
it to work in this scenario then the "rendering" mechanism would have to
ensure that the same conditions do exist.

Niall

----- Original Message ----- 
From: "Matthias Wessendorf" <ma...@matthias-wessendorf.de>
To: <de...@struts.apache.org>
Sent: Wednesday, July 14, 2004 12:25 PM
Subject: getValidationKey()


Hi,

just looked at DynaValidatorForm & DynaValidatorActionForm
saw, DynaValidatorActionForm has no validate() more but

getValidationKey() that returns the path...
it is the overwritten method from DynaValidatorForm

sawing also, that getValidationKey() gets trigered
in DynaValidatorForm.validate()

the same for ValidatorActionForm.java

now my question, why is getValidationKey() public ?
and not protected ?

is this method in any other use?
(i didn't found one...)

Cheers,

Matthias Weßendorf
Aechterhoek 18
DE-48282 Emsdetten
Germany
Email: matthias AT wessendorf DOT net
URL: http://www.wessendorf.net


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org