The best way to debug Mojarra and Primefaces in eclipse?

无人久伴 提交于 2019-12-11 09:31:06

问题


PF 3.5.10, Mojarra 2.1.21, JBoss 7.1.1, Omnifaces 1.5

Sometimes I have problems with JSF which are complicated to understand, and difficult to solve. E.g. my question Duplicate id error with primefaces dialog in template . So my question(s) is what do I need to debug Mojarra.

Now I can set debug points in Mojarra sources.

a) What Mojarra (or primefaces) Methods are a good start point to begin the debugging ?

b) As in my example if I want to find out why JSF (or primefaces) generate duplicate id, which methods should I observe (and debug) to find out the reason.

c) Do you have any tips for debugging ?


回答1:


Your best to avoid problems with ids is not using the id attribute if you don't need to specifically refer to it in the view (for example, an Ajax update over the component). Just let JSF assign its own-generated id, that way you avoid duplicates.

About the debugging, check the javax.faces.webapp.FacesServlet class, which is the Servlet where JSF does its work. Here you'll be able to check each building and rendering process. However, don't obsess debugging your JSF implementation's internal classes, they are supposed to be tested, you should keep your own code in mind.

So my tip is: start debugging your own methods!



来源:https://stackoverflow.com/questions/18512903/the-best-way-to-debug-mojarra-and-primefaces-in-eclipse

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