Re: Short-circuiting validation when a type conversion error occurs

tm_jee <[email protected]> Sat, 16 Dec 2006 23:51:38 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <2484621.1166334729105.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
Hi Emil, 

I guess as you have just pointed out, one way would be to turn off global conversion error for this request (having the "conversionError" interceptor taken off the stack for this request) and have a field level "conversion" validator with short-circuit turned on.

[code]
 <field ...>
    <field-validator name="conversion" short-circuit="true">
         <param name="repopulateField">true</param>
    </field-validator>
    <field-validator ...>
         ....
    </field-validator>
    .....
 </field>
[/code]

or maybe have a global-level validator with short-circuit="true" that sees if there's a conversion error, if so, make the validation fails 

[code]
<validator name="myCustomValidator" short-curcuit="true">
  ....
</validator>
<field ...>
  ....
</field>
[/code]

the conversion error could be checked using

[code]
  actionContext.getConversionErrors();
[/code]

cheers.
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=53139&messageID=108291#108291

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]