You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Bullard, James" <JB...@AR.SONY.COM> on 2004/06/08 21:55:23 UTC

saveErrors and saveMessages implementation question.

Hello, I am using the template design pattern (abstract superclass which
extends action and declares a myExecute method which will be called in the
execute method of the Abstract class)

In the superclass I have a local variable errors which in the finally clause
will be saved, irrespective of what happened in the call to myExecute. The
problem is that saveErrors will delete the key Globals.ERROR_KEY in the
request if you pass in null, without checking whether other errors have been
added. 

It is a simple workaround:

if (!errors.isEmpty()) {
   saveErrors(request, errors); 
}

However, the case where both record errors is not so simple, or it is
certainly not as clean as just calling saveErrors and having the new errors
added to the end of the errors which are currently in the request. 

Is this the desired implementation if so I am not clear as to why. Thanks
much .. 

jim

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