Vaadin navigating to @RequestMapping
The UI.getCurrent().navigate(...)
, and other Router
navigation methods, can only be used for navigating to routes registered with Vaadin (e.g. using @Route
).
In your case I'd recommend using an Anchor
instead of a button. It corresponds to a normal <a>
link in the browser, and you can give it any URL. Another benefit is that no server-roundtrip is needed.
Alternatively you can try using the Button
as you do, but navigating with UI.getCurrent().getPage().setLocation(...)
. If that doesn't work, try UI.getCurrent().getPage().executeJs("window.open('your_url', '_blank')")
.