Can I use jsf component libraries(primefaces) with spring mvc .I have problem with client side development so i want a simple way of creating user interfaces .And I dont like jsf life cycle .I need a way of using component libraries.
问题:
回答1:
JSF and Spring MVC have completely different ideologies. The one is a component based MVC framework and the other is a request based MVC framework. Mixing this makes no sense. You normally choose the one or the other. A component based MVC framework has the advantage that it minimizes the HTML/CSS/JS boilerplate code and the server side request processing, but this brings the disadvantage back that you don't have fine grained control over the generated HTML/CSS/JS and the server side request processing. For that you'd need a request based MVC framework. But this has in turn the disadvantage that you need to write all that HTML/CSS/JS boilerplate and server side request processing yourself.
If you want to stick to Spring MVC and want a rich UI, I suggest to look at a JavaScript based UI library, such as jQuery UI.
See also:
- What is the need of JSF, when UI can be achieved from CSS, HTML, JavaScript, jQuery?