How to force WebSphere AS 8 to use a specific JSF implementation?

青春壹個敷衍的年華 提交于 2019-12-19 09:05:52

问题


I have an old enterprise application that was developed using WAS 6.1, now my company is trying to perform the implementation of that application in WAS 8. But I am having troubles rendering the JSF content, there are some links that when clicked the JS debugger says Uncaught ReferenceError: myfaces is not defined being the rendered HTML:

onclick="return myfaces.oam.submitForm('top_nav:frmTopNav','top_nav:frmTopNav:lnkCP',null,[['default_sort','name']]);"

So I think it's not rendering it well because of the different versions of JSF between my old application and WAS 8.

Now I decided to force it, downloading the MyFaces 1.1 with Tomahawk 1.1.7 and putting them in the WEB-INF/lib folder, and now it says java.lang.IllegalArgumentException - Class org.mything.LocaleViewHandler is no javax.faces.application.ViewHandler

Why could this be happening?

Thank you in advance.


回答1:


Quoting from WAS 8 infocenter, Configuring JavaServer Faces implementation

If you want to use a third-party JSF implementation that is not shipped with the product, then:

  • Keep the configuration set to MyFaces.
  • Add the third-party listener to the web.xml file that is required.
  • Add the third-party implementation Java archive (JAR) files to the application as an isolated shared library and associate it with your application.

On the above referenced page you may find details on Creating shared libraries and Associating shared libraries with applications or modules.




回答2:


Make sure that you are using PARENT_LAST classloading.

Otherwise it will load its own JSF 2.0 libs first and your class doesn't match the interface. You should check though if you could update to MyFaces 2.0.



来源:https://stackoverflow.com/questions/11477995/how-to-force-websphere-as-8-to-use-a-specific-jsf-implementation

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