Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faces Standard Converters CDI ApplicationScoped #1952

Open
pizzi80 opened this issue Aug 8, 2024 · 4 comments
Open

Faces Standard Converters CDI ApplicationScoped #1952

pizzi80 opened this issue Aug 8, 2024 · 4 comments

Comments

@pizzi80
Copy link

pizzi80 commented Aug 8, 2024

Add @ApplicationScoped on stateless converters (BigInteger, BigDecimal, Float, .... )

1 line of code for each class, simple and effective

@tandraschko
Copy link

i dont think default converters/validators are managed by CDI?!

@pizzi80
Copy link
Author

pizzi80 commented Aug 8, 2024

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

@tandraschko
Copy link

this issue is so much bigger

  1. if we make CDI the default for converters/validators, we need: Remove class scanning and rely on CDI only? #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

@pizzi80
Copy link
Author

pizzi80 commented Aug 8, 2024

this issue is so much bigger

  1. if we make CDI the default for converters/validators, we need: Remove class scanning and rely on CDI only? #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

exactly 😃

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?

https://jakarta.ee/specifications/coreprofile/11/jakarta-coreprofile-spec-11.0-m4#required_components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants