You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by Hasan Turksoy <ht...@gmail.com> on 2007/02/21 11:30:56 UTC

[shale-validator] CommonsValidator doesn't take component converters into account!

hi all,

Env: jsf1.1, commons-validator1.3.1, shale1.0.4..

i'am trying to put a required validator for my date entering field.. My
field has a f:convertDateTime to make conversion between String <->
java.util.Date. it's like;

<h:inputtext ...>
  <f:convertDateTime dateStyle="short" />
  <s:commonsvalidator type="required" arg="..." client="true" server="true"
/>
</h:inputtext>

When i entered a valid value into my date field it throws a
ConverterException as below;

"javax.faces.ConverterException: You have requested a conversion for type
java.util.Date, but there is no by-type converter registered for this type."

as i understand; it needs a converter for the java.util.Date class.. But in
JSF, one can assign custom converter tags as above sample...

this means, (my suggestion) commonsvalidator should get the converter for
that type from component. if component don't have any converters assigned,
it should lookup for a by-type converter then... Otherwise, i will have to
define by-type converters for all my component converters! this will be
stupid i think...

any comments?? or solutions??

thanks in advance,
hasan...