开发者

Spring MVC, what view components to use?

开发者 https://www.devze.com 2023-04-06 01:18 出处:网络
I´m facing a project whe开发者_高级运维re 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 mo

I´m facing a project whe开发者_高级运维re 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:

  • What in-house expertise do you guys have?
  • Do you want to expand your skillset or stay put?
  • Whatever view/presentation layer framework you use, make sure its robust, meets your needs, has an active release schedule, and a healthy user group.
  • Do a comparison between frameworks, and decide on the one that works best for 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.


If you want to stay with Spring MVC i would suggest you just use JSP and JQuery, ofcourse you will need to write alot more views...

But i think if you want to use them both you could use Spring Webflow? I haven't used MVC and webflow together much but i hear they work great together? Don't use the springfaces and such because they are really outdated and discontinued since jsf1 or so...

http://www.springsource.org/webflow for some information


spring mvc is not component framework. so, you should use javascript and jsp/velocity/freemaker.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号