0

has anyone been able to make Vaadin's Upload component working with Spring Boot?

workarounds like disabling spring's multipart upload doesn't work for me. (through I need multipart)

this is my project pom.xml config:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.2.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
        <java.version>1.8</java.version>
        <vaadin.version>10.0.7</vaadin.version>
    </properties>

    <pluginRepositories>
        <!-- Repository needed for prerelease versions of Vaadin -->
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

    <repositories>
        <!-- Repository needed for prerelease versions of Vaadin -->
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>
        <!-- Repository used by many Vaadin add-ons -->
        <repository>
            <id>Vaadin Directory</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jersey</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-upload-flow</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-tabs-flow</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-text-field-flow</artifactId>
            <!--<version>LATEST</version>-->
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-grid-flow</artifactId>
        </dependency>

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>42.2.5</version>
        </dependency>

    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

application.propertis:

spring.servlet.multipart.enabled=false
spring.mvc.hiddenmethod.filter.enabled=false

I have tried Vaadin 12, 13 and as you see 10.0.7

None of the Upload's listeners are being called.

Maybe can you recommend any other way/component to substitute Vaadin's UI Upload?

EDIT: here's the test repo: https://github.com/zapphyre/vaadin-upload-test.git

Thanks

greengold
  • 1,184
  • 3
  • 18
  • 43
  • Yes I use the Upload component in a spring boot application. What exactly isn't working for you? can you show the relevant code? – kscherrer Mar 08 '19 at 16:25
  • You are not the first to encounter this - [here](https://github.com/vaadin/spring/issues/381) is the github issue about it, but seeing your application.properties I guess that you have already read it. – kscherrer Mar 08 '19 at 16:38
  • right, I need some go around – greengold Mar 09 '19 at 11:54

1 Answers1

0

actually it (this workaround set in the .properties file) works, I just discovered, I had another set of .properties file on the project root which were probably overriding the ones in resources..

greengold
  • 1,184
  • 3
  • 18
  • 43