Is it possible to use js library in jsf project

I want to use the javascript library in a java web application, and I wonder if this is possible in a jsf application (e.g. Ice Faces or Prime Faces?).

Are there any rules that should be followed when integrating the use of the js library into a jsf project? What should I remember and how to do it?

+4
source share
3 answers

There is only one JSF Framework, and the latest version is 2.1 and is not primarily associated with the js framework. Remember that JSF and any other web framework, such as Struts or Spring, should help in the development cycle by providing a mature MVC framework, but beyond that it is a pure Java web application.

Like any web application, you can add any JavaScript infrastructure that you need to work with (for example, extjs ). In particular, JSF has component frame components that you can add with ajax features such as RichFaces and PrimeFaces, both of them come with jQuery, and you should check the submitted version before trying to add your own version of jQuery.

+3
source

You can, and in fact, some JSF frameworks come with the JS library. I think Ice Faces comes with jQuery for example. While this is possible, you have to be very careful, as JSF frameworks like to manage the DOM itself.

So yes, you can, but I would strongly advise you if you are not very careful and will not manipulate the DOM so that your infrastructure does not expect.

+2
source

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


All Articles