Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3434

JSONValidationInterceptor thows exception used with OValValidationInterceptor

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.8.1
    • 2.3.1
    • Plugin - JSON
    • struts-json-plugin 2.1.8.1

    Description

      in the method protected String buildResponse(ValidationAware validationAware) of org.apache.struts2.interceptor.validation.JSONValidationInterceptor line 149 the work around described in WW-2721 tries to remove "model." from fieldError.key. But when using OValValidationInterceptor the fieldError.key doesn't contains the substring "model." so, the code should be sometring like:

      sb.append(validationAware instanceof ModelDriven ? fieldError.getKey(). replaceFirst("model
      .", "")
      : fieldError.getKey());

      thank you

      Attachments

        Activity

          lukaszlenart Lukasz Lenart added a comment -

          The code changed and now it checks if "model." exists in a key

          sb.append(((validationAware instanceof ModelDriven) &&  fieldErrorKey.startsWith("model."))
                                      ? fieldErrorKey.substring(6)
                                      : fieldErrorKey);
          

          So it should work as well with OValValidationInterceptor now, could you confirm ?

          lukaszlenart Lukasz Lenart added a comment - The code changed and now it checks if "model." exists in a key sb.append(((validationAware instanceof ModelDriven) && fieldErrorKey.startsWith( "model." )) ? fieldErrorKey.substring(6) : fieldErrorKey); So it should work as well with OValValidationInterceptor now, could you confirm ?
          lukaszlenart Lukasz Lenart added a comment -

          Already fixed

          lukaszlenart Lukasz Lenart added a comment - Already fixed

          People

            lukaszlenart Lukasz Lenart
            nickmancol Nicolas Bohorquez Gutierrez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: