51. Replacing Scriptlet Code with a Backing Bean (cont.) 12 Facelet code: <a href="#{standardHeaderManagedBean.partnerUrl}" target="top">…</a>
52. Replacing Scriptlet Code Using Unified EL 13 Example Sciptlet Code: <% if (!GenericValidator.isBlankOrNull(partnerBO.getPartnerUrl())) { … } else { … } %> Put the above code in BackingBean (ManagedBean) as much a possible.
53. Converting JSPs Pages to Facelet Pages (2) 14 Conditional Statements in JSPs. <c:choose/>, <c:if/> and <c:forEach> can be avoided unless we are sure it would not create problems with the compile-time vs render-time issue. It can be replaced with <ui:fragmentrendrered=“#{boolean}”/> <c:forEach/> can be replaced with <ui:repeat/> MyFaces Tomahawk also has some components that can be use for such conditions. Read: http://www.ilikespam.com/blog/c:foreach-vs-ui:repeat-in-facelets http://drewdev.blogspot.com/2008/03/build-time-vs-render-time.html
54.
55. Find common functionality that can be shared and refactor to common beans vs. implementing one backing bean per view
56. Most backing beans should be request scoped (as opposed to session or application scope)