Open pizzi80 opened 1 month ago
i dont think default converters/validators are managed by CDI?!
don't know if this new Faces API package requires CDI
... probably could/should ?
Many years ago I read a blog post of @arjantijms proposing to switch to CDI to find Converters and Validators
Mojarra use both class scan and CDI
In my fork of Mojarra I use CDI @ApplicationScoped
for all stateless converters, 1 instance per webapp...
otherwise they could be manually instantiated and cached
I was proposing the CDI solution because it's a 1 line of code
this issue is so much bigger 1) if we make CDI the default for converters/validators, we need: https://github.com/jakartaee/faces/issues/1584 2) we need to remove managed=true attr on annotations 3) we need to rework specs and impls 4) then we can just add @ApplicationScoped
this issue is so much bigger
- if we make CDI the default for converters/validators, we need: Remove class scanning and rely on CDI only? #1584
- we need to remove managed=true attr on annotations
- we need to rework specs and impls
- then we can just add @ApplicationScoped
exactly :smiley:
I admit that for a 5.0 version of Faces one could expect all these things ...
CDI is now a Jakarta Core requirements, isn't it?
Add
@ApplicationScoped
on stateless converters (BigInteger, BigDecimal, Float, .... )1 line of code for each class, simple and effective