cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <>
Subject formvalidator problem
Date Thu, 06 Sep 2001 17:40:22 GMT
Hi All,

My understanding of the form validator is:

for each constraint in the constraint set

	if (request parameter not null)
		validate constraints
		if (not nullable)
			if (default exists)
				substitute default for null value


However because there is no setParameter() method on the Request object, it
is impossible for the default value to be substituted. Therefore currently
the default value mechanism does not work in FormValidatorAction.

One possibility is to set the new value into an attribute, but this requires
that any action that expects a value from a parameter must now check the
attributes. This involves changing existing actions (possibly lots of them).
I've produced a patch for AbstractDatabaseAction which allows attributes to
override parameters but I'm hanging on to it until I can get the best
overall solution clear in my head.

Can somebody please explain to me why there is no setParameter() method on
the Request object? I'm sure there's a very good design reason, but for me
it seems a very quick and easy solution to allowing a chain of actions
working on the same request to update the request parameters as they flow
through the actions.

The alternative seems to be to have *every* action read from both attributes
and parameters and set new values into attributes. If this is the solution
then perhaps we can produce a single helper object where this work can be

I understand that you are all very busy with the next build but I think this
is quite a serious problem when requests flow through a chain of actions.

Thanks and Best Regards,


Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly

To unsubscribe, e-mail:
For additional commands, email:

View raw message