Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
bean discovery mode
i was doing the cdi-vaadin tutorial and i think there are serveral issues very important that the tutorial doesn't mention.
I use wildfly as server.
1 - The file beans.xml is mandatory if you intend to use cdi.
2 - You must use bean discovery mode "all" and not "annotated" in the bean.xml file
If you use annotated the server:
- Doesn't recognize the vaadin-cdi beans (@UIScoped, ...)
- You must write @Dependent (this is the default scope in CDI specification).
Thanks for the important suggestions. Let's see if I can get someone to update that tutorial. It seems to need some revising anyways. And just to make sure? You mean this tutorial: https://vaadin.com/wiki/-/wiki/Main/Vaadin+CDI
Yes this is the tutorial.
Well, the tutorial use another server TomEE ( wildfly needs beans.xml (even if it is empty) ).
The discovery mode is a little bizarre but explain differents behaviour of scanning the beans cdi.
I'm a begginner, i just only get an explanaition (but i supposed this questions are to Wildfy Forum in JBoss web).
It 's normal the out of date in a tutorial with it is made two years ago (it is mentioned in the tutoria).
English is not my maternal language so it is weird for me when you said... it seems to need some love???
I edited my answer to make the language less metaphorical.