Generating conversion errors

Richard Wallace <[email protected]> Wed, 20 Dec 2006 20:49:51 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <16847514.1166669422214.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
Hello,

I've got a custom converter similar to the one in WebWork in Action that converts between domain objects and their IDs.  If I enter an invalid ID, i.e. one that doesn't exist or a non-integer string, the converter just returns null.  I had thought that returning null or returning the original value would cause WebWork to generate a conversion error, but no luck.  So, the property of my action just winds up being null, which triggers a my required validator, but I want to be able to distinguish between a conversion error and the required validation error.  Should it do something other than return null or the original value?  Throw an exception or something?

Thanks,
Rich
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=54592&messageID=109296#109296