You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by St...@national.com.au on 2002/11/19 06:20:23 UTC

How do you map errors occuring in ProcessBean with fields on a screen?

Currently when using Scaffold Action classes and ProcessBean, messages can
be added to the ProcessResult object.


The BaseAction constructs ActionErrors using the messages in the
ProcessResult object and ActionErrors.GLOBAL_ERROR as the property mapping.


This means that you can't map an error directly to a field on a screen.
This becomes more of a problem when the data in error is contained within
an iteration and you want the message to be displayed with the item within
the iteration..





Has anyone out there had a need to do the same thing?


If so, how did you get around this?





Here's a snippet from one of the ProcessBean classes in the Artimus example
app.  As you can see a message can be added but I can't see how you can
pass back some sort of field key with the message



        ProcessResult result = new ProcessResultBase(this);
           if (0==resultCode)
                result.addMessage(Tokens.DATA_ACCESS_EMPTY);
            else
                result.addMessage(Tokens.DATA_RECORD_RESTORED);
            result.addMessage(article.toString());

        return (Object) result;


Thanks,
Steve.
__________________________________________________________________________
The information contained in this email communication may be confidential.
You
should only read, disclose, re-transmit, copy, distribute, act in reliance
on or
commercialise the information if you are authorised to do so. If you are
not the
intended recipient of this email communication, please notify us
immediately by
email to NABpost@national.com.au or reply by email direct to the sender
and then destroy any electronic or paper copy of this message.  Any views
expressed in this email communication are those of the individual sender,
except
where the sender specifically states them to be the views of a member of
the
National Australia Bank Group of companies.  The National Australia Bank
Group
of companies does not represent, warrant or guarantee that the integrity of
this
communication has been maintained nor that the communication is free of
errors,
virus or interference.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>