Just Released: Developing JSF Portlets with WebLogic Portal Whitepaper
A supplemental developer's guide has been published to help guide WLP 10.x customers that wish to use JSF as the web framework for building portlets on WebLogic Portal. This is a sizable document (150 pages) that covers a large number of topics. It also coaches developers on best practices and common pitfalls.
Important: It also clarifies the supported configuration of JSF within Portal Web Projects. Workshop for WebLogic by default configures a web project in a configuration that is not supported by WebLogic Portal. The guide explains how to address this:
* Change from the unsupported MyFaces JSF implementation to the supported Sun Reference Implementation (RI)
* Change from the unsupported "client" STATE_SAVING_METHOD to the supported "server"
The guide can be downloaded here:
http://download.oracle.com/technology/products/weblogic/portal/weblogic-portal-jsf-whitepaper.pdf
To help internet searches locate this document, the table of contents is reproduced below:
Introduction
1.1. Prerequisites...................................................................... 8
1.2. Applicable Versions............................................................ 8
1.3. Native Portlet Bridges and Standard Portlet Bridges .......... 8
1.4. JSF Portlet Support Roadmap ........................................... 9
1.5. Whitepaper Structure ....................................................... 10
1.6. Look Before You Leap ..................................................... 10
1.7. For More Information........................................................ 10
Part 1: Converting JSF Applications into Portlets
2. IDE Support for JSF Portlets Chapter ...................................... 12
2.1. Workshop for WebLogic – WebLogic Portal's Supported IDE 12
2.2. Workshop Features for JSF Support in WebLogic Portal.. 12
3. Introduction to JSF Portlets Chapter ........................................ 18
3.1. Creating Your First JSF Portlet......................................... 18
3.2. Essentials of JSF Portlet Views........................................ 21
3.3. WebLogic Portal Artifacts................................................. 22
4. Configuring JSF within WebLogic Portal Chapter..................... 24
4.1. JSF Library Modules in WebLogic Server ........................ 24
4.2. Installing the JSF Libraries into a Portal Web Project ....... 25
4.3. JSF Configuration Settings............................................... 27
4.4. Configuring JSF 1.2 ......................................................... 29
4.5. Building an Unsupported JSF Implementation Library Module 31
4.6. Faces Configuration is Web Application Scoped.............. 31
5. Navigation within a JSF Portlet Chapter................................... 33
5.1. Navigating within a Portlet with the JSF Controller ........... 33
5.2. Redirects.......................................................................... 34
6. Namespacing Chapter ............................................................. 35
6.1. Namespacing Managed Bean Names.............................. 35
6.2. Client ID Namespacing with the View and Subview Components 35
6.3. Client ID Namespacing with the WLP NamingContainer .. 36
7. Logging, Iterative Development, and Debugging Chapter ........ 39
7.1. Logging............................................................................ 39
7.2. Iterative Development ...................................................... 39
7.3. Debugging ....................................................................... 40
8. Custom JavaScript Chapter ..................................................... 42
8.1. DOM Manipulation within a JSF ....................................... 42
8.2. Form Validation within a JSF Portlet ................................ 45
9. Preparing JSF Portlets for Production Chapter ........................ 46
9.1. Configuration.................................................................... 46
9.2. Performance and Scalability............................................. 47
9.3. Security............................................................................ 49
9.4. Localization...................................................................... 50
Part 2: Interacting with the Portal Environment
10. Native Bridge Architecture Chapter ...................................... 54
10.1. Container Architecture Overview.................................. 54
10.2. Container Architecture.................................................. 54
10.3. Container Interactions .................................................. 55
11. Interportlet Communication Chapter .................................... 56
11.1. Using Session and Request Attributes for IPC (Anti-pattern) 56
11.2. Using the WLP Event Facility for IPC with JSF Portlets 56
11.3. Notifications ................................................................. 60
11.4. Comparison of the IPC Approaches ............................. 60
12. Scopes Chapter ................................................................... 62
12.1. Conceptual Scopes for Standard JSF Applications ...... 62
12.2. Conceptual Scopes for Portal Applications................... 63
12.3. Implementation Patterns for Portal Scopes .................. 63
13. State Sharing Patterns Chapter ........................................... 66
13.1. State Sharing Concepts ............................................... 66
13.2. HttpSession Versus HttpServletRequest ...................... 66
13.3. Base Code for HttpSession Patterns ............................ 67
13.4. Single Portlet Pattern ................................................... 68
13.5. Multiple Portlet Patterns ............................................... 69
14. Rendering Lifecycles Chapter .............................................. 77
14.1. WLP and JSF Lifecycles .............................................. 77
14.2. Invocation Order of WLP and JSF Lifecycle Methods... 77
14.3. Accessing WLP Context Objects from JSF Managed Beans 78
15. Portal Navigation Chapter .................................................... 80
15.1. Programmatically Constructing JSF Portlet URLs ........ 80
15.2. Changing the Active Portal Page.................................. 80
15.3. Redirects within a Portal............................................... 83
16. Ajax Enablement Chapter .................................................... 85
16.1. Ajax in JSF Portlets...................................................... 85
16.2. Partial Page Rendering Pattern.................................... 85
16.3. Stateless API Request Pattern ..................................... 86
16.4. Portlet Aware API Request Pattern .............................. 87
16.5. Controlling the WLP Ajax Framework........................... 91
17. Additional WLP Features Chapter........................................ 93
17.2. Portlet Container Features ........................................... 93
17.3. Portal Container Features ............................................ 98
18. Example: Implementing a Login Portlet Chapter .................. 99
18.1. Login Portlet Motivation................................................ 99
18.2. Login Portlet Design..................................................... 99
18.3. Login Portlet Implementation...................................... 101
Part 3: Integrating Third Party Libraries
19. Integration Overview Chapter............................................. 111
19.1. Types of Libraries....................................................... 111
19.2. Roadmap for MyFaces Trinidad and ADF Faces Rich Client 111
20. Using the Facelets View Technology Chapter.................... 113
20.1. Introduction to Facelets .............................................. 113
20.2. Configuring Facelets Support ..................................... 113
21. Using the Apache MyFaces Tomahawk Component Library Chapter 115
21.1. What is Apache MyFaces Tomahawk? ...................... 115
21.2. Support for Tomahawk in WLP................................... 115
21.3. Tomahawk Component List........................................ 116
21.4. Installing and Configuring Tomahawk......................... 119
21.5. Resolving the Duplicate ID Issue................................ 120
21.6. Referring to Resources .............................................. 120
21.7. forceId Attribute.......................................................... 124
21.8. File Upload................................................................. 125
22. Using the Apache Beehive Navigation Controller Chapter . 126
22.1. Apache Beehive Page Flow ....................................... 126
22.2. JSF and Page Flows .................................................. 126
22.3. Configuring the JSF Integration with Page Flows ....... 127
Appendices
23. Appendix 1: Consolidated List of Best Practices ................ 130
24. Appendix 2: Known Issues and Workarounds.................... 132
24.1. CR383659, CR383662 Inconsistent failures with JSF portlets 132
24.2. CR342124: IllegalStateException due to duplicate client-id 132
24.3. CR384916: IllegalStateException due to duplicate client-id when using certain components such as Tomahawk and Trinidad...... 133
24.4. CR361477 Problems with the integration of JSF portlets with Apache Beehive Page Flows.................................................................. 133
24.5. CR377945 JSF 1.2 suffers from a memory leak during iterative development .............................................................................. 134
25. Appendix 3: The JSFPortletHelper Class ........................... 135
26. Appendix 4: The CleanupPhaseListener Class .................. 147