Is it possible to use JSF 2.0 (PrimeFaces for example) as view layer for Play Framework? I'd like to combine elastic hot redeployment of Play with easy component driven JSF developement (instead of MVC and template driven GUI design).
I think all I need is - 1. Run FAces Servlet (javax.faces.webapp.FacesServlet) and maybe some other servlet 2. Tweak el-resolver in faces-config.xml just like org.springframework.web.jsf.el.SpringBeanFacesELResolver does.
Have anyone did something like this? I'm new in Play Framework. I use JSF + Spring + JPA now.
Play is rock-solid and used by hundreds of thousands of Java and Scala developers every month. Play is still extremely relevant to today's application and web development and has a passionate and very capable community around it ensuring that it has many good years left.
As JSF is part of the Java standard, it is popular with development teams that want to stick to published standards for increased portability across platforms. JSF also allows existing backend Java code to be extended with a web interface without having to refactor the base application by introducing a new framework.
Who uses Play? 289 companies reportedly use Play in their tech stacks, including LinkedIn, Glovo, and Accenture.
Play Framework makes it easy to build web applications with Java & Scala. Play is based on a lightweight, stateless, web-friendly architecture. Built on Akka, Play provides predictable and minimal resource consumption (CPU, memory, threads) for highly-scalable applications.
JSF is fully based on the stateful aspect of Java EE web stack and on the servlet API! Play is just a full stateless framework and doesn't use servlet API at all!
So the answer is "No you shouldn't use JSF as the view layer of Play". I use "shouldn't" instead of "can't" because everything is possible but it was be really bad thing!
Nevertheless, you really should think about leaving JSF after wanting to leave MVC. If Play! exists, it's not only because of Rails/Django/Symfony are good, it's also because JSF-like frameworks aren't good, efficient and viable solutions for many reasons you can find everywhere on the web or even in your own experience maybe.
I would advise you just to give a try to Play+JPA (or even something else to replace JPA such as Siena) for real. Don't begin by mixing Java EE stuff with it, use Play 100% to see how it performs. If you need to use Spring with Play, there is no problem but it's not required in many cases. You will discover how easy and efficient it is to build apps from the smallest to the biggest enterprise ones. In my experience, since I use Play, I find this framework promises things and keeps them which is very rare in this world!
Have fun!
By default, no this is not possible.
Play does not conform to the J2EE specification, and as such does not implement the Servlet specification.
However, it may be possible, with a fair amount of effort. Play developers have already created a ServletWrapper that allows Play to be deployed to standard servlet containers (like JBoss and Tomcat etc), so they have shown that you can integrate with J2EE technology, if you want to spend the time and effort to write your own Plugin that overwrites the default nature of Play.
I wouldn't bother though. Just take a look at the template engine that comes with Play. It is very good, and I have not missed JSPs at all since using Groovy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With