5

I have created a Spring MVC project with JSP and Hibernate and it works great. Now I would like to use Facelets instead of JSP.

My thought is to use Facelets like PrimeFaces as view instead of JSP, Spring MVC framework in the middle and probably Hibernate in the backend.

Is it possible? If yes, how can I achieve this ? If not, why not?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Human Being
  • 8,269
  • 28
  • 93
  • 136
  • 1
    @BalusC I hope u helps me. – Human Being Sep 02 '13 at 11:47
  • 3
    Sorry, I don't do Spring/MVC. I just use the standard Java EE stack. I can at least tell that this makes no utter sense, theoretically considered. PrimeFaces is a JSF component library **with** a Facelets taglib, not a standalone Facelets taglib which you could use with any other MVC framework orso as you seemed to think. Ultimately you still need JSF for PrimeFaces. You really have to make the decision between JSF **or** Spring MVC. See further also http://stackoverflow.com/a/4424775 If you want PrimeFaces-like UI, just grab jQuery/UI (which is also what they use under covers). – BalusC Sep 02 '13 at 11:54
  • Thanks for the reply.Is it possible to use the `primefaces` within the normal `JSP` just like a third party library ? – Human Being Sep 02 '13 at 12:05
  • 1
    PrimeFaces as being a JSF 2.0 compatible component library doesn't have a JSP taglib. JSP is deprecated since JSF 2.0 in December 2009. Generally, all JSF 2.0 compatible component libraries have only a Facelets taglib. – BalusC Sep 02 '13 at 12:13
  • Oh ok. I this possible to use JSF(only for look and feel-view ) and Spring MVC for middle ?Because I need primefaces component features for my existing spring applicaiton. – Human Being Sep 02 '13 at 12:17
  • 5
    I now start to think that you're confusing Spring MVC with Spring DI. Spring MVC is absolutely not a middle layer framework. Spring MVC is a frontend framework and essentially a full competitor of JSF. Perhaps helpful/related/duplicate read: http://stackoverflow.com/questions/8522856/jsf-component-libraries-with-spring-mvc and http://stackoverflow.com/questions/18369356/when-is-it-necessary-or-convenient-to-use-springjsf2-or-ejb3jsf2-or-all-of-the/ – BalusC Sep 02 '13 at 12:36
  • 1
    Now I got the point what you are trying to say . Sorry for asked the stupid questions. – Human Being Sep 02 '13 at 12:44

1 Answers1

3

Yes, if you are talking about Spring, of course that is possible. The Spring documentation mentions it. If you want integration of JSF and Spring MVC, then it is probably useless, since you don't need any Spring MVC controller to build your JSF pages.

You also don't need JSP. Your pages will be coded using Facelets tags.

There are many tutorials and examples available on the web. For instance:

Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
LaurentG
  • 11,128
  • 9
  • 51
  • 66
  • 1
    Thanks for quick reply.Sorry and I think you wrongly understood my question. – Human Being Sep 02 '13 at 11:40
  • 1
    My aim is to use the **facelets(xhtml) like primefaces frontend(view) instead of JSP or how to use the Primefaces in jSP, Spring MVC framework in the middle and probably Hibernate in the backend** . – Human Being Sep 02 '13 at 11:42