Reading Portlet Preferences in Weblogic Portal
| Posted by watashii | Filed under Programming, WebPortlet preferences enables portlets to be associated with external application data. This data should generally be used to store (or update) configuration data in a portlet. For example, to store/update dynamic stock codes in a stock quotes portlet. A portlet preference is basically a name-value pair data structure.
Portlet preferences can be added/updated in the following ways:
- During design-time on Workshop for Weblogic Portal (screenshot above)
- Invoked programmatically at request-time using javax.portlet.* API
- Manually during run-time of a portal (via Portal Administration Console when a portal desktop is created)
When we have added our preferences, we can read them using using the Weblogic Portal API’s. The following sample code fragments are for JSP Portlets, and JSF Portlets:
