I´m facing a project where I need to build a presentation layer, where a lot of the logic is already implemented in Spring MVC 3. I´ve been working a little with Spring before, but mostly with Struts 2 (in case that´s relevent…).
Lately I´ve also been working with Primefaces, which builds on JSF 2. I really like it since you get loads of good looking components out-of-the-box, that are really easy to implement.
I´ve done some reading, and from what I understand you COULD use JSF on top of Spring MVC, but it would add a lot of complexity to the application, and that doesn´t feel like a good choice since I´m pretty sure I´d regret that further down the road.
There´s ofcourse also the alternative to remove the Spring MVC bits and rewrite them to fit JSF 2 instead, but I have a feeling that would include A LOT of work…
So, what approach would you guys recommend? Is there anything like Primefaces that would fit well into Spring MVC? Or would you just go JSP + jQuery?
(this is the drawback of Java imho, there are just TOO many choices)
BR
Daniel
This is a classic question, and there is no one “correct” answer. Since Spring MVC integrates with so many technologies, at the end of the day its really up to you:
For instance, I was working in a shop that had a Spring MVC app with a JSP/jQuery front-end, and a developer wanted to use JSF. No one knew it, no one had time to learn it, and we could accomplish what we needed to get done with the existing app. So, even though JSF has much to offer, we didn’t change strategies mid-stream. That decision was not a knock against JSF – it was a decision that was based on our situation.