JSF 2 on top of Play! Framework

Can I use JSF 2.0 (e.g. PrimeFaces) as the presentation layer for the Play Framework? I would like to combine Play's resilient hot relocation with lightweight component JSF development (instead of MVC and a GUI template).

I think all I need is 1. Run the sulfur servlet (javax.faces.webapp.FacesServlet) and maybe some other servlet 2. Tweak el-resolver in faces-config.xml, like org.springframework .web.jsf.el.SpringBeanFacesELResolver does.

Has anyone done something like this? I am new to Play Framework. Now I am using JSF + Spring + JPA.

+6
source share
3 answers

JSF is completely based on the Java EE state aspect as well as on the servlet API! Play is just a full stateless structure and does not use the servlet API at all!

So the answer is: "No, you should not use JSF as the Play presentation layer." I use "should not", but not "can not", because everything is possible, but it would be very bad!

However, you should really consider leaving JSF after you want to leave MVC. If you play! It exists not only because of Rails / Django / Symfony, but also because JSF-like frameworks are not good, effective and viable solutions for many reasons that you can find everywhere on the Internet or even in your own experience.

I would advise you to just try playing + JPA (or even something else to replace JPA, for example, Siena). Don't start by mixing Java EE with it, use Play 100% to see how it works. If you need to use Spring with Play, there is no problem, but in many cases this is not required. You will learn how to easily and efficiently create applications from the smallest to the largest. In my experience, since I use Play, I find this framework promises things and save them, which is very rare in this world!

Good luck

+17
source

By default, this is not possible.

Play does not conform to the J2EE specification and thus does not implement the servlet specification.

However, this may be possible with sufficient effort. Game developers have already created ServletWrapper, which allows you to deploy Play to standard servlet containers (for example, JBoss and Tomcat, etc.), so they showed that you can integrate with J2EE technology if you want to spend time and effort to write your own Own Plugin that overwrites the nature of the game by default.

I would not bother. Just take a look at the template engine that comes with Play. This is very good, and I did not miss JSP at all since I used Groovy.

+7
source

You can use JSF2.2 + Primefaces and the Spring + AKKA framework, which is better and faster than playing.

-1
source

Source: https://habr.com/ru/post/895834/


All Articles