This page contains the source code for some example portlets that might help you getting started developing portlets.
This is a the mandatory Hello world example in portlet style (GenericPortlet).
The HelloWorld portlet demonstrates how to:
The source code for the HelloWorld portlet is available for download as a zip here:
helloworld.zip Zip, 15.2 kB.
This is a sample (GenericPortlet) portlet that demonstrates how to use the PortletMode.EDIT that allows user-specific portlet preferences.
The source code for the Editmode portlet is available for download as a zip here:
editmode.zip Zip, 93.7 kB.
This is a sample (GenericPortlet) portlet that demonstrates how to use the SiteVision-specific config PortletMode that allows update of the shared portlet preferences.
I.e. this portlet mimicks the behaviour of the build-in portlets bundled with SiteVision. A editor can double-click the portlet and edit the portlet settings, and this affects all users. (PortletMode.EDIT defined by JSR 168 is per user, SiteVisions config mode is per instance)
The ConfigMode portlet demonstrates how to:
The source code for the Configmode portlet is available for download as a zip here:
configmode.zip Zip, 4.3 kB.
This is a sample (GenericPortlet) portlet that displays information for certain Nasdaq stocks. In order to get stock information, the portlet consumes a Web Service available at http://www.webservicex.net/WS/WSDetails.aspx?WSID=9&CATID=2.
Note that the communication between the portlet and the web service doesn't use any Web Services framework. This portlet should only be seen as an example of a portlet that has some kind of business logic (i.e. calls a web service) - NOT an example of how to properly handle Web Services from a portlet!
The Nasdaq portlet demonstrates how to:
The source code for the Nasdaq portlet is available for download as a zipped rar here: webservices-example.rar Rar file, 874.7 kB. . More information about the portlet and how to build it can be found in the INFO file.
A generic Struts 2 portlet can be generated via Maven. You can find out more about this on the Struts 2 Portlet Tutorial.
The page published: