Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50355

@QueryParameter in form validation is not filled for dropdownDescriptorSelector when using nonpublic class

XMLWordPrintable

      I’m trying to use form validation on a dropdownDescriptorSelector, however here the validation method parameters (annotated with @QueryParameter) are not found and set to null (or 0). (If used standalone the validation works).

      Is there anything different with a dropdownDescriptorSelector? Or is this caused since the jelly views are in different plugins that use different class loaders?

      The relevant main jelly part:

      <f:entry description="${description.tool}">
      	<f:dropdownDescriptorSelector field="tool" title="${%title.tool}"
      		descriptors="${descriptor.availableTools}"/>
      </f:entry>
      

      (whole file: ScanForIssuesStep/config.jelly)

      The relevant jelly part of the referenced Describable:

      <f:entry title="${%High priority threshold}"
              description="${%Minimum number of duplicated lines for high priority warnings.}"
              field="highThreshold">
       <f:textbox default="50"/>
      </f:entry>
      

      (whole file: DuplicateCodeScanner/config.jelly)

      My validation method:

      public FormValidation doCheckHighThreshold(@QueryParameter final int highThreshold,
             @QueryParameter final int normalThreshold) {
         return VALIDATION.validateHigh(highThreshold, normalThreshold);
      }
      

      (whole file: DuplicateCodeScanner.java)

      Both parameters are always set to zero when setting a breakpoint here.

            Unassigned Unassigned
            drulli Ulli Hafner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: