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

Spring MVC - Kotlin: Cannot bind MultipartFile in constructor

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1.3
    • Fix Version/s: 5.2 RC1
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      When using spring mvc with Kotlin,  I prefer to use data classes  with immutable fields.  This works for most cases.  However, when I'm using MultipartFile as a field on a request object, I am forced to use a var field and make the field nullable in order to get it to work.

      I've attached a sample project exhibiting this behavior.  Just follow the instructions in the README.txt.

        Attachments

          Activity

            People

            Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            rbohn Ryan Bohn
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              3 years, 24 weeks, 5 days ago