Search code examples
vaadinvaadin8

Vaadin UIScope import does not compile


I have a problem with @UIScope annotation in vaadin 8.9.0. Here is some snippet:

package com.negdoor;

import com.vaadin.flow.spring.annotation.SpringComponent;
import com.vaadin.flow.spring.annotation.UIScope;
import com.vaadin.server.Page;
import com.vaadin.ui.UI;

@UIScope
@SpringComponent
public class Current {

    private UI ui;

    public void set(UI ui) {
        this.setUi(ui);
    }

    public Page getPage() {
        Page result = null;
        if (ui != null)
            result = ui.getPage();
        return result;
    }

    public UI getUi() {
        return ui;
    }

    public void setUi(UI ui) {
        this.ui = ui;
    }

}

The result is: enter image description here

What am i doing wrong ?


Solution

  • It looks like you are importing Vaadin Spring add-on version 12.x whily you should use version 3.2.1 with Vaadin 8.9.0.