what are the minimal JSF jars needed to deploy a JSF app with Tomcat

给你一囗甜甜゛ 提交于 2020-06-27 17:08:26

问题


I know that a minimal API is 4 jars, I remember facelets*.jar. What are the minimal JSF jars needed to deploy a JSF app with Tomcat?


回答1:


Just use the JAR files which are provided/required by the JSF implementation you choose to use. Just download the implementation and read their own installation/users guide if you don't actually need more JAR files (as dependencies).

As of now there are only two major JSF implementations: Mojarra and MyFaces. The number of JAR files may vary per implementation and even version. Ultimately you need to make sure that you have both the JSF API and JSF implementation (which may exist of 2 or even 1 JAR file, depending on impl/version). MyFaces requires more commons-*.jar dependencies while Mojarra doesn't require any additional dependencies.

Since JSF 2.0, Facelets is bundled with the JSF implementation and has replaced JSP as default view technology.

See also:

  • Our JSF wiki page



回答2:


These two are enough to start a simple web app using JSF 2.1 with tomcat 7.

javax.faces-2.1.14.jar

and

jstl-1.1.0.jar



回答3:


You can run a JSF application with tomcat by either including Mojarra libraries or by including jars.

1. To include Mojarra libraries,

While creating an JSF application, it asks for JSF implementation library. Select option 'User library' and then click on 'Download library' option as shown in the below image.

It will then search for the libraries and show an option like below,

Select the mojarra library and then accept the "Terms and conditions" and click on "Finish".

2. Include below jars

Download JSF-API Jar http://central.maven.org/maven2/com/sun/faces/jsf-api/

Download JSF-IMPL Jar http://central.maven.org/maven2/com/sun/faces/jsf-impl/



来源:https://stackoverflow.com/questions/9251882/what-are-the-minimal-jsf-jars-needed-to-deploy-a-jsf-app-with-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!