Uploaded image for project: 'Shale'
  1. Shale
  2. SHALE-412

CommonsValidator doesn't take component converters into account!

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.4
    • 1.0.5
    • Validator
    • None
    • jsf1.1, shale.1.0.4, commons-validator.1.3.1
    • Important

    Description

      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."

      the problem is; CommonsValidator always looks for by-type converters.. so, it needs a converter for the java.util.Date class.. But in JSF, one can add custom converter for each component separately... in this case, even if i had a converter for java.util.Date class, it won't be used by JSF RI!
      Because, user assigned a custom converter for that field!! JSF will use it instead of looking for a by-type converter... so, commons should use it too... otherwise, JSF RI and CommonsValidator behaving differently as my issue!

      In conclusion; when we look at JSF RI code, we see that; it first looks for custom component converter, then, if can not find, searches for a by-type converter... CommonsValidator must work same i think...

      i have injected my solution into my CommonsValidator class and it works perfect... above suggestion should be implemented in original CommonsValidator releases as soon as possible i think...

      i can provide code if required...

      there is a conversation about this issue at :
      http://www.nabble.com/CommonsValidator-doesn%27t-take-component-converters-into-account%21-tf3266040.html

      Attachments

        Activity

          People

            gvanmatre@comcast.net Gary VanMatre
            hasant Hasan Turksoy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: