How are the jsf-api and jsf-impl related?

孤街醉人 提交于 2020-01-04 02:40:11

问题


For some time I am struggling to get an arquillian test case running. This test involves classes rooted in JSF classes and it ran into an ClassFormatError: Absent Code as the implementation for the javax.faces.model.DataModel could not be found.

My assumption was that I need to provide my test with a JSF implementation, but the implementations I found (for example the one bundled with JBoss) do not have the javax.faces package, only com.sun, and I could find no trace of the DataModel class.

Where am I misunderstanding the way it works here? Why doesn't the impl actually implement the api?


回答1:


The API:

  • the public types to which consumers can write code to

The implementation:

  • private types consumers should not rely on
  • implementation details including things like markup (e.g. HTML) and container (e.g. servlet)

This separation isn't as clean as it should be, but this is largely the intent. Separation into these two jars are how the developers chose to organise the code but you'll need both to utilize the library in most contexts.



来源:https://stackoverflow.com/questions/13048970/how-are-the-jsf-api-and-jsf-impl-related

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