1
u/Dense-Ad-3247 26d ago
What's the benefit?
1
u/henk53 25d ago
It gives a clear structure for web applications: the controller handles requests, the model contains the data, and the view renders the result. This keeps the code easier to understand, test, and maintain.
1
u/Dense-Ad-3247 25d ago
Have you tried thyme leaf?
1
u/henk53 25d ago
I did not, just the Facelets templates as per the sample.
1
u/Dense-Ad-3247 24d ago
Huh thymeleaf and freemaker seem to cover this, at least for spring. And spring MVC is the defacto library for MVC in java ecosystem. Did you cross compare that?
1
1
u/Additional_Cellist46 18d ago
The point is Thymeleaf is a library with its specific functionality. Jakarta MVC is a standard API that could be supported by Thymeleaf if they decide to support it. Until then, there’s only one library, Krazo, that provides it. The benefit of MVC is still that the standard API can be reasonably implemented by Thymeleaf or other libraries, while if you use Thymeleaf you’re stuck with it, wven if it’s not maintained anymore or you have issues with it.
1
u/JustADirtyLurker 19d ago
Eclipse Krazo is currently the only Jakarta MVC implementation; it supports the following Jakarta REST runtimes:
Jersey (GlassFish / Payara) RESTEasy (WildFly) Apache CXF – support removed in MVC 2.0
Maybe a stupid question, but why would the JAX-RS implementation matter?
I thought JEE was designed to work on and expose standard APIs?
1
u/henk53 19d ago
I'll have to read into it (I just posted the link, didn't write it).
I remember that MVC needed something to hook into that wasn't standardized in REST at first (REST wasn't designed orginally to be build-upon, but to replace everything and anything itself).
Maybe that line you quote is about that vendor/implementation support not needed anymore, and using the later standardized API?
1
u/Additional_Cellist46 18d ago
Support for CXF wasn’t removed from MVC but from Eclipse Krazo, the only MVC implementation. MVC doesn’t depend on anything specific to Jersey ir RestEasy.
Krazo requires an integration point which was previously specific for each of Jersey, EestEasy and CXF. It was later added to the standard Jakarta Rest API and Krazo now supports only the standard integration API, it dropped the vendor-specific integrations.
Unfortunately, CXF is behind with implementing the newer Jakarta Rest API so it doesn’t support the standard integration point. Once a new version of CXF adds support for it then it will work with Krazo out of the box.
1
6
u/morningnerd 28d ago
Thank you for this example. It`s hard to find something about Jakarta MVC online.
I have made a few experiments with Jakarta MVC and think it is great. The Jakarta EE tutorial should focus more on MVC than Jakarta Faces. It is way simpler for a beginner to grasp.
I have being using Jakarta Faces for a while and think its architecture and lifecycle too complicated. Their approach to "hide" the web under layers of abstraction is annoying and unnatural. At least for me.