Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15676

Request params Optional<List<String> and List<String> are inconsistent

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.4
    • Fix Version/s: 4.3.12, 5.0 GA
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      When using List<String> as the request parameter, both key=val1,val2 and key=val1&key=val2 end up mapping to key = [val1, val2]

      When using Optional<List<String>> as the request parameter
      key=val1,val2 maps to key = Optional([val1,val2])
      but key=val1&key=val2 maps to Optional([val1])

      This makes RequestParam(..., required = false) List<String> behave differently from RequestParam(...) Optional<List<String>>, which seems unfortunate.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                juergen.hoeller Juergen Hoeller
                Reporter:
                ayush-veem Ayush Kumar
                Last updater:
                Spring Issuemaster
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  40 weeks, 1 day ago