You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kornelis Sietsma <ko...@sietsma.com> on 2003/07/09 05:11:30 UTC

Converting an ActionError to a string programmatically

Hi all.

I am looking for a good way to turn an ActionError into a string, without having a
PageContext or anything else so useful (so I can't use the RequestUtils.message()
function).

Is there a simple way to do this?  I can probably do it the hard way, by digging
through the RequestUtils source and working out what it does, but I'm hoping that
either (a) there is another utility class I've missed that will do this, or (b)
someone else has done this and can save me the pain!

The reason I need this is that I have some code that updates a back-end system, and
returns ActionErrors if there are any validation failures.  Usually this gets called
from a struts action, and the errors get displayed to the user with the <errors/>
tag.

However, now we need to do some background batch updates, called from a thread
spawned from a servlet (which is outside our normal struts pages).  The batch process
is likely to be slow, and so we want the results of any validation failures to get
logged to an error file, rather than getting displayed to the user.

Any suggestions?

- Korny
--
Kornelis Sietsma   http://www.sietsma.com/korny  korny@sietsma.com
goofey: korny  yahoo: kornysietsma  icq: 2039172 ph: 0421 079 693

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