>
> How do you envision that working? Would individual
> messages have an
> optional "severity" property? (i.e. "error",
> "warning", possibly
> others) Or would there be one bundle of messages for
> each severity?
>
> I've taken to using a generic BusinessProcessResult
> object (sometimes
> extended with process-specific details) which carries
> with it three
> lists messages: "message," "warning," and "error".
> (Actually, it can
> ave other lists with arbitrary keys, but those three
> have
> "privileged" status in the API.)
>
> For our purposes, it could be a "ValidationResult"
> which gets passed
> around through the different validators, each of
> which can add to any
> of the lists as appropriate.
>
> Seems like something which people might not like as a
> matter of
> taste, but I've found it pretty handy. It's also a
> bigger model
> change from both Struts and Webwork than may be
> appropriate at this
> time.
Actually it's no change at all :-) See my response to Don. Here's the types of
methods in there:
void setAction[Errors|Warnings|Messages](Collection messages);
Collection getAction[Errors|Warnings|Messages]();
void setFieldErrors(Map errorMap);
/**
* @return Map with errors mapped from fieldname (String) to Collection of
String error messages
*/
Map getFieldErrors();
void addAction[Error|Warning|Message](String message);
void addFieldError(String fieldName, String errorMessage);
boolean hasAction[Errors|Warnings|Messages]();
/**
* @return (hasActionErrors() || hasFieldErrors())
*/
boolean hasErrors();
boolean hasFieldErrors();
>
> In short, I think it's nice to have a "warning" level
> if we can work
> out a clean way to support it.
>
> Joe
>
Oops... just noticed it doesn't have "Warnings" in there, but it would be very
easy to add.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=29317&messageID=57069#57069
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]