If you're just starting to think about applying the portal solution, or trying to understand how easy it is to integrate a new or existing JSF application into a portal environment, this article is definitely worth perusing.
Over the past few years, portals has developed in both the enterprise and the Enhanced Portlet 2.0 (JSR 286) specification. The new 2.0 version of Portlets is a great freedom for developers to aggregate different applications and render them in different windows of the same page. In addition, it provides authentication features, mature personalization features, and a better out-of-the-box approach to handling Ajax.
The advent of the JSR specification Portlet bridging specification (Portlet Bridge) gives us the standard way to run JSF applications, whether the Portlets version is 1.0 or 2.0. Portlet Bridges (bridge) can dominate the Action/render paradigm of the portal to properly handle the life cycle of the JSF. This tutorial will primarily show you how easy it is to configure and develop a JSF portlet, as well as introduce the new JBoss Portlet Container 2.0 and some of its cool new features.
This article is the first of a series of three-part articles. This series of articles from the basic JSF portlet and portal knowledge has been about the advanced usage of Ajax and seam in the portlet environment.
Now, get ready to start!
Project installation
Development tools:
To successfully practice the examples in this article, download the latest version of Maven (I'm using version 2.0.9).
Install Maven 2.0.9+.
Sets the environment variable for the MAVEN binary version.
Examples of server and binary versions used:
JBoss Portal ' s Portlet Container 2.0
JBoss Portlet Bridge BETA3
Currently, JBoss Portlet Bridge is the only implementation of the JSR 301 specification, which allows you to run any combination of JSF, richfaces, and seam. Your project's MAVEN configuration can be arranged to download packaged JBoss as and JBoss Portlet Container 2.0, where you can find these files if you want to download them separately. Otherwise, give Maven a few minutes to download the appropriate files.
Note-This Portlet can also be run in the current 2.6.5.SP1 version of the JBoss portal, and I have used the JBoss Portlet Container 2.0 in this article, but bridge can work both. Here you can learn about the configuration methods that make it available to run in any version of the JBoss portal.
The following MAVEN prototype (Maven archetype) is an easy way to create a project that can quickly establish and run a starter project (or template project). Once you have run these commands, you will have all the files you need to practice this example.
Open a terminal window and run the following instructions:
mvn archetype:generate -DarchetypeGroupId=org.jboss.portletbridge.archetypes
-DarchetypeArtifactId=1.2-basic
-DarchetypeVersion=1.0.0.B3 -DgroupId=org.whatever.project -DartifactId=myprojectname
-DarchetypeRepository=http://repository.jboss.org/maven2/ -Dversion=1.0.0.B3
Now, find the file directory where your new project is located (if you're using the same example as above, the directory name should be "MyProjectName"), browse through all the files you just created, and you'll see a basic MAVEN file structure with the source code that applies to the example in this article. Now you can open your favorite IDE environment and introduce this MAVEN project.