Hello,
I have the problem that Push isn’t working anymore.
I created a new project
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.4.5
Edited the MyUI.java file
/**
*
*/
@Theme("mytheme")
@Widgetset("test.MyAppWidgetset")
@Push
public class MyUI extends UI {
VerticalLayout layout = new VerticalLayout();
@Override
protected void init(VaadinRequest vaadinRequest) {
layout.setMargin(true);
setContent(layout);
Button button = new Button("Click Me");
button.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
layout.addComponent(new Label("Thank you for clicking"));
}
});
layout.addComponent(button);
new InitializerThread().start();
}
class InitializerThread extends Thread {
@Override
public void run() {
// Do initialization which takes some time.
// Here represented by a 1s sleep
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
// Init done, update the UI after doing locking
access(new Runnable() {
@Override
public void run() {
// Here the UI is locked and can be updated
layout.removeAllComponents();
layout
.addComponent(new TextArea("This is the real UI"));
}
});
}
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
mvn vaadin:compile
mvn jetty:run
So it’s only working if I hit up localhost:8080. If i use 127.0.0.1:8080 or my LAN IP it is stuck.
Any idea how I can solve this?
Thank you in advance