Beruflich Dokumente
Kultur Dokumente
Managing the Liferay portal with the Eclipse Web Tools Platform (WTP)
Skill Level: Intermediate Matthew Scarpino Java Developer Eclipse Engineering, LLC
24 Apr 2007 Web developers can build multifunctional portals by arranging simple, reusable, event-driven components called portlets. Eclipse makes this process even simpler. First, find out how the Eclipse Web Tools Platform (WTP) provides a complete development environment for editing the code and configuration files needed for portlet projects. Then, by integrating the Apache Geronimo Eclipse plug-in, learn how you can deploy and display these portlets inside a full portal by accessing the Geronimo application server.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 1 of 31
developerWorks
ibm.com/developerWorks
The Liferay portal to provide the overall structure It takes some effort to install these components and work out the version incompatibilities. But after configuration, the process of building and deploying the portal is straightforward.
Objectives
This tutorial covers: Organizing and simplifying portal development with the Eclipse WTP. Structuring portlets within the Liferay portal. Deploying a servlet-based portlet application to a Geronimo application server. Deploying a JavaServer Pages (JSP)-based portlet application with a Geronimo application server.
Prerequisites
This tutorial is written for enterprise Java developers whose skills and experience are at a beginning to intermediate level. You should have a general familiarity with Java technology, servlets, and JSP pages as well as a passing familiarity with Eclipse and how it manages projects.
System requirements
To start this tutorial, you need a recent version of Eclipse 3.2 or later on your system. You install the WTP, Geronimo server, Geronimo server run time, and Liferay portal platform during the course of the tutorial.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 2 of 31
ibm.com/developerWorks
developerWorks
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 3 of 31
developerWorks
ibm.com/developerWorks
Many free example portlets, including chat clients, calendars, clocks, and RSS feeds. Liferay vs. Pluto
Pluto is included in Geronimo and is released by the Apache Software Foundation, so I feel compelled to explain why I chose Liferay as the portal framework for this tutorial. It comes down to ease of deployment. Liferay provides a Web application that runs immediately within Geronimo. But the Pluto artifact in the Geronimo repository isn't packaged as a Web application and isn't initialized when Geronimo starts. So it would have taken a lot of effort to configure a Pluto application for Geronimo and integrate it within the Apache Tomcat container. Also, according to the documentation on the Pluto site, Maven is the preferred application for accessing Pluto. Maven provides many advantages for large project management, but as I've learned from painful experience, the Maven plug-in doesn't play well with Eclipse and the WTP. The Pluto site also mentions (in bright red letters!) that "to automate the deployment/installation of portlets, you must utilize the source distribution of Pluto." This would mean creating and modifying an Eclipse project with all the Pluto source code and dependent libraries. With Liferay, you never need to touch the source code to deploy portlets. Finally, Liferay provides such a wealth of freely available portlets and functions that I'd feel compelled to mention it even if I'd chosen Pluto as the portlet container. And not only is Liferay's documentation vast compared to Pluto's, but it even provides video tutorials of how to perform common tasks. So far, I've been very impressed with Liferay in fact, my only complaint against it is that it provides too much capability.
In addition, Liferay contains a large-scale framework for deploying intranet applications across dispersed locations. In this way, administrators in a large institution can customize the portal for each branch, location, and community of their institution.
ibm.com/developerWorks
developerWorks
for other components to interact with. Some of the most important components in Geronimo include the following: ActiveMQ Message Broker OpenEJB Enterprise JavaBeans (EJB) container Tomcat or Jetty Web container Remote Method Invocation (RMI)-based naming service Apache Derby Relational Database Management System (RDBMS) Geronimo can use either the Tomcat or Jetty Web container to deploy its applications, but this tutorial relies on Geronimo with Tomcat installed. If you've used Tomcat alone, much of the operation described here will look familiar. However, you can't access Tomcat directly. Instead, you'll need to deploy your applications using one of the three Geronimo deployment methods: The deploy command-line tool The Geronimo Web Console The hot deployer This last option involves sending the Web application to the $(GERONIMO)/deploy directory, where Geronimo detects it. In this tutorial, Eclipse automatically performs hot deployment. During deployment, Geronimo creates a new element in its repository for the application. This element, called an artifact, is identified by a specific directory structure. Any applications that depend on it must know this structure. Here, the example portlet application depends on the Liferay artifact, and I'll show you how to inform Geronimo about this dependency. But first, you must know how to acquire and configure the software for this tutorial.
developerWorks
ibm.com/developerWorks
You need the following four main components: WTP 1.5.1: This feature allows you to create and edit Eclipse projects for dynamic Web applications. It also provides for directly deploying these applications using Web or application servers. Geronimo Server Runtime: This Eclipse plug-in enables the WTP feature to access a Geronimo server and use it to deploy applications. Geronimo application server: The Geronimo server deploys the portlet applications within the Liferay portal. Liferay portal: The Liferay Web application provides the structural framework to hold and display your portlets.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 6 of 31
ibm.com/developerWorks
developerWorks
4.
Select the Callisto Discovery Site check box, and then click Finish. Note: The Callisto Discovery Site packages large feature projects like the WTP and ensures version compatibility between them. Click OK when the list of mirror sites appears. The page shown in Figure 2 appears. Figure 2. Selecting the WTP features
5.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 7 of 31
developerWorks
ibm.com/developerWorks
6.
Select the Web and J2EE Development check box. This tells the manager to download the features corresponding to the Eclipse WTP. You'll see a warning that this feature requires additional features to function. To make sure that you have all the necessary dependencies, such as the Visual Editor, Graphical Editor Framework (GEF), and Eclipse Modeling Framework (EMF), click Select Required. When the warning disappears, click Next and accept the license agreement. Click Next, and then click Finish. Note: If you continue to see a dependency warning, even after clicking Select Required, you may need to acquire a newer, or possibly more stable, version of Eclipse. Choose to install all the features, and restart Eclipse. To verify that the features have been added, go to Help > About Eclipse SDK, and click Feature Details.
7.
8.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 8 of 31
ibm.com/developerWorks
developerWorks
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 9 of 31
developerWorks
ibm.com/developerWorks
2.
Click Add on the right to add a new server run time. The New Server Runtime window, shown in Figure 4, shows that WTP already supports several servers, including JBoss and Tomcat. But alas, Geronimo isn't listed. Click the Don't see your vendor listed? Click here link to see which additional server run times are available. Figure 4. Available server run times
3.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 10 of 31
ibm.com/developerWorks
developerWorks
4.
In the Install New Server window, select the preferred version of Geronimo (this tutorial uses version 1.1), and then click Next. Remember the version number. Accept the license agreement, click Finish, and then click OK in the window that appears. Eclipse downloads the Geronimo runtime environment and asks whether you want to restart the workbench. Click Yes.
5. 6.
Download Geronimo
So far, you've incorporated the Eclipse WTP into Eclipse and added support for the Geronimo application server. The next task is to download the server itself.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved. Trademarks Page 11 of 31
developerWorks
ibm.com/developerWorks
To download the Geronimo application server, perform the following steps: 1. 2. 3. 4. Choose File > New > Other, and then select the Server option under the Server category. Click Next to see the Define a New Server window again. This time, when you open the Apache category, you'll see options for Geronimo. Select the version of Geronimo for which you installed support, and then click Next. In the next window, type a directory location in the Application Server Installation Directory box, and make sure that the Geronimo with Tomcat option is selected. Click Download and Install, and then click OK. When the download is complete, click Finish. To test the server, open the J2EE Perspective by choosing Window > Open Perspective > Other and selecting J2EE. As shown in Figure 5, a new set of tabs appears in the lower view section of the workbench. Figure 5. Starting the Geronimo server
5. 6. 7.
8.
Click the Servers tab, and then click Run (circled in blue).
Watch the Console view to see which Geronimo modules are starting as well as the application modules and Web applications. To see the main Geronimo Administration Console, click the toolbar item that looks like a globe, and type http://localhost:8080/console in the address field. Type system as the user name and manager as the password. The browser view should look something like Figure 6. Figure 6. The Geronimo Administration Console
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 12 of 31
ibm.com/developerWorks
developerWorks
Note: If you don't see the globe item on the toolbar, choose Window > Show View > Other, and then select the Internal Web Browser option under the General category. You'll use this console in the next section, so I recommend that you keep it open. If you need to stop Geronimo, just click the red square to the right of the Run button when the Servers tab is visible.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 13 of 31
developerWorks
ibm.com/developerWorks
2.
Scroll down until you see the Application Server Plugins section. There should be at least two links for downloading Configuration Archive (CAR) files: liferay-portal-geronimo-tomcat-a.b.c.car contains the Liferay module that plugs into the Geronimo server. liferay-portal-geronimo-derby-pool-a.b.c.car contains the files needed to interface Liferay with the Derby database module included in the Geronimo installation.
3. 4.
Click these links. After you've downloaded both plug-ins, return to the Geronimo Application Console in the Eclipse Web browser. Because you've downloaded these plug-ins separately instead of accessing a plug-in repository, you'll need to use Geronimo's deploy command from the command line. This file (deploy.bat in Microsoft Windows or deploy.sh in UNIX or Linux) resides in Geronimo's top-level bin directory, so add this directory to your PATH environmental variable. Open a command prompt, change to the directory containing the two CAR files, and type the following commands in order (remember that the default user name is system, and the password is manager): deploy install-plugin liferay-portal-geronimo-derby-pool-a.b.c.car deploy install-plugin liferay-portal-geronimo-tomcat-a.b.c.car Don't be concerned if you receive an error during the second installation. It probably means that the second plug-in was installed correctly but couldn't be started. To take care of the problem, go to the Geronimo Administration Console, and click the Web App Wars link under the Applications heading. The new window, which displays Geronimo's Web applications, should look similar to Figure 7. Figure 7. Starting the Liferay Console in Geronimo
5.
6.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 14 of 31
ibm.com/developerWorks
developerWorks
You can see the context of each application in the URL column. The top-most application uses the /remote-deploy context, and the console for the Tomcat server uses the root context, or /. 7. But the last application, the Liferay portal, also wants this root context, so uninstall the Tomcat Console by clicking Uninstall in the same row as geronimo/welcome-tomcat/a.b.c/car. Then, start the Liferay portal by clicking Start. Note: Neither of these actions affects the Geronimo Console. It may take some time, but after Geronimo starts the Liferay portal application, go to http://localhost:8080/ in the Eclipse Web browser. The page that appears looks similar to the Liferay home page; to see the portal, click the Sign in link in the upper right. Then, in the text boxes that appear, type test@liferay.com as your user name and test as your password. If all goes well, you'll see the page shown in Figure 8. Figure 8. The Liferay portal
8.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 15 of 31
developerWorks
ibm.com/developerWorks
Before continuing, take a moment to look through the Liferay portal. Explore the portlets and click the different links and tabs. All these capabilities, from the clock to the calendar, are freely available when you start creating your own applications.
Create web.xml
To create the web.xml and geronimo-web.xml files you need, perform the following
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved. Trademarks Page 16 of 31
ibm.com/developerWorks
developerWorks
steps: 1. 2. 3. Within Eclipse, choose File > New > Project. Select Dynamic Web Project under the Web option. Name the project simpleportlet, then click Finish. When you open the folders in the project, the project should look similar to Figure 9. Figure 9. Initial structure of the Portlet project
Two important deployment descriptors appear at the bottom of the project: web.xml and geronimo-web.xml. The first describes the Web component in general, and the second tells Geronimo how the application should be packaged and deployed. In the project, modify web.xml so that its content matches that shown in Listing 1. This means removing the welcome-file-list element and adding context-param, listener, servlet, servlet-mapping, and taglib elements, each shown in bold in the listing. Listing 1. The web.xml deployment descriptor
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved. Trademarks Page 17 of 31
developerWorks
ibm.com/developerWorks
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>simpleportlet</display-name> <context-param> <param-name>company_id</param-name> <param-value>liferay.com</param-value> </context-param> <listener> <listener-class> com.liferay.portal.kernel.servlet.PortletContextListener </listener-class> </listener> <servlet> <servlet-name>simpleportlet</servlet-name> <servlet-class> com.liferay.portal.kernel.servlet.PortletServlet </servlet-class> <init-param> <param-name>portlet-class</param-name> <param-value>org.dworks.SimplePortlet</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>simpleportlet</servlet-name> <url-pattern>/simpleportlet/*</url-pattern> </servlet-mapping> </web-app>
Create geronimo-web.xml
The second deployment descriptor for this tutorial, geronimo-web.xml, accomplishes two tasks: It tells Geronimo where and how to store the application within its repository. It specifies that your portlet application depends on the Liferay portal module. Add the bold text in Listing 2 to your file. Listing 2. The geronimo-web.xml deployment descriptor
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.1"> <sys:environment> <sys:moduleId>
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 18 of 31
ibm.com/developerWorks
developerWorks
<sys:groupId>default</sys:groupId> <sys:artifactId>simpleportlet</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:moduleId> <sys:dependencies> <sys:dependency> <sys:groupId>liferay</sys:groupId> <sys:artifactId>liferay-portal-tomcat</sys:artifactId> </sys:dependency> </sys:dependencies> </sys:environment> </web-app>
The <moduleId> element contains four subelements that specify where the project's deployed module should be placed in Geronimo's repository: groupId: The entity that created the file (for example, Apache) artifactId: The name of the file version: The file version type: The format of the file (for example, JAR) But to declare the application's module dependency, the descriptor needs to identify only the groupId and artifactId subelements of the Liferay portal. To see how these parameters relate to the file location, open the repository directory under Geronimo's top-level directory. Each repository subdirectory takes its name from a module's groupId, and each module file can be found in the $(GERONIMO)/repository/groupId/artifactId/version folder.
Create portlet.xml
Create a file called portlet.xml in the project's WEB-INF directory, and add the content in Listing 3 to it. The elements here have the same names and functions as those of servlets in web.xml, so this looks familiar. One interesting difference about portlet descriptors is that they describe what modes of operation are available for a
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 19 of 31
developerWorks
ibm.com/developerWorks
portlet. JSR 168 introduces the basic View, Edit, and Help modes, but you can create custom modes as needed. Only the view mode is required for a portlet; because there are no <portlet-mode> subelements beneath the <supports> element in Listing 3, the View mode is the only one this simple portlet supports. Listing 3. The portlet.xml deployment descriptor
<?xml version="1.0"?> <portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"> <portlet> <portlet-name>simpleportlet</portlet-name> <display-name>Simple Portlet</display-name> <portlet-class>org.dworks.SimplePortlet</portlet-class> <expiration-cache>0</expiration-cache> <supports> <mime-type>text/html</mime-type> </supports> <portlet-info> <title>Simple Portlet</title> <short-title>Simple Portlet</short-title> <keywords>Simple Portlet</keywords> </portlet-info> <security-role-ref> <role-name>administrator</role-name> </security-role-ref> <security-role-ref> <role-name>guest</role-name> </security-role-ref> <security-role-ref> <role-name>power-user</role-name> </security-role-ref> <security-role-ref> <role-name>user</role-name> </security-role-ref> </portlet> </portlet-app>
Create liferay-portlet.xml
Create another file called liferay-portlet.xml in the WEB-INF directory, and add the content shown in Listing 4. This file matches the security roles of portlet.xml with the specific and similarly named roles in Liferay. If the instanceable element is set to true, the portlet can be added multiple times to the layout of the Liferay portal. Listing 4. The liferay-portlet.xml deployment descriptor
<?xml version="1.0"?> <!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 4.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_4_2_0.dtd"> <liferay-portlet-app>
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 20 of 31
ibm.com/developerWorks
developerWorks
<portlet> <portlet-name>simpleportlet</portlet-name> <instanceable>true</instanceable> </portlet> <role-mapper> <role-name>administrator</role-name> <role-link>Administrator</role-link> </role-mapper> <role-mapper> <role-name>guest</role-name> <role-link>Guest</role-link> </role-mapper> <role-mapper> <role-name>power-user</role-name> <role-link>Power User</role-link> </role-mapper> <role-mapper> <role-name>user</role-name> <role-link>User</role-link> </role-mapper> </liferay-portlet-app>
Create liferay-display.xml
Create one last .xml file, liferay-display.xml, in the WEB-INF directory, and add the content shown in Listing 5. This file tells the portal which category the portlet will be listed in. I'll cover the Liferay categories when I explain the process of deploying and viewing Liferay portlets. For now, all you need to know is that the simple portlet application will fall under the Test category. Listing 5. The liferay-display.xml descriptor
<?xml version="1.0"?> <!DOCTYPE display PUBLIC "-//Liferay//DTD Display 4.0.0//EN" "http://www.liferay.com/dtd/liferay-display_4_0_0.dtd"> <display> <category name="category.test"> <portlet id="simpleportlet" /> </category> </display>
With the five descriptors (web.xml, geronimo-web.xml, portlet.xml, liferay-portlet.xml, and liferay-display.xml) completed, you've taken care of interfacing the server and the portal. Next, you code the portlet's actual operation.
developerWorks
ibm.com/developerWorks
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 22 of 31
ibm.com/developerWorks
developerWorks
3. 4.
Click Finish. Type or paste the code shown in Listing 6. Listing 6. SimplePortlet.java
package org.dworks; import import import import import import java.io.IOException; java.io.PrintWriter; javax.portlet.GenericPortlet; javax.portlet.RenderRequest; javax.portlet.RenderResponse; javax.portlet.PortletException;
public class SimplePortlet extends GenericPortlet { protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { String portletName = "Portlet Name: " + getPortletConfig().getPortletName(); String companyName = "Company Name: " + getPortletConfig().getPortletContext() .getInitParameter("company_id"); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(portletName+"<br />"+companyName); } }
The portlet's operation is straightforward. The doView() method accesses the configuration object (PortletConfig) to get the portlet's name. Then it uses its context object (PortletContext) to get the initial parameter specified in web.xml. Like a regular servlet, it displays both pieces of information by acquiring the PrintWriter of the response object.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 23 of 31
developerWorks
ibm.com/developerWorks
By default, Eclipse sets the context of your application to the project name. But for a portlet project, you must set the context equal to that of its portal, which for Liferay is simply the root directory. To change this: 1. 2. 3. Right-click the project name in the Navigator, then choose Properties. Select the Web Project Settings option on the right. Delete all text in the Context Root box.
Figure 11 shows my project structure. Yours may differ, but you should make sure that the project files are in the right folders. Figure 11. Structure of the completed Portlet project
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 24 of 31
ibm.com/developerWorks
developerWorks
5.
Open the Test category, and click Add next to the Simple Portlet option. You should see a new window in the portal that looks like Figure 13. Figure 13. The Simple Portlet window
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 25 of 31
developerWorks
ibm.com/developerWorks
3. 4.
Modify the servlet class to dispatch processing to the JSP page. Create the JSP page within the project.
This process won't change the project name or its deployment within Geronimo and Liferay, so there's no need to change any of the deployment descriptors except web.xml.
2.
3. 4. 5.
<?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> ... <jsp-config> <taglib> <taglib-uri>http://java.sun.com/portlet</taglib-uri> <taglib-location>/WEB-INF/tags/liferay-portlet.tld</taglib-location> </taglib> </jsp-config>
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 26 of 31
ibm.com/developerWorks
developerWorks
</web-app>
6.
The new servlet doesn't access the RenderResponse directly, but it dispatches processing to the JSP page. Change the doView method to the code shown in Listing 8. Listing 8. Updated doView() method of SimplePortlet.java
protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/view.jsp"); prd.include(request, response); }
The JSP code, shown in Listing 9, uses portlet-specific tags to access the portlet's configuration object. It provides the same output as the earlier servlet, but the HTML structure makes it easier to read and change. Note: Eclipse may give you an error about not resolving the portletConfig object, but it should still deploy and display properly. Listing 9. View.jsp
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %> <portlet:defineObjects /> Portlet Name: <%= portletConfig.getPortletName() %> Company Name: <%= portletConfig.getPortletContext().getInitParameter("company_id") %>
The defineObjects tag makes the renderRequest, renderResponse, and portletConfig objects accessible within the JSP page. Then the portletConfig object provides access to the portlet's name and context object. Other available tags include the actionURL tag, which tells the portlet to perform an action, and the renderURL tag, which sends a render request to the portlet. The namespace tag sets aside a section of the code to use only the identifiers associated with the portlet.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 27 of 31
developerWorks
ibm.com/developerWorks
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 28 of 31
ibm.com/developerWorks
developerWorks
Downloads
Description
Servlet-based portal application1 JSP-based portal application
2
Name
simpleportlet-servlet.war.zip simpleportlet-jsp.war.zip
Size
4KB 91KB
Download method
HTTP HTTP
More downloads Demo: Liferay home page Demo: JSR 286 standard site Notes
1 Example portlet project using a servlet 2 Example portlet project using a JSP page. Both projects have the same name, so they can't be imported into the Eclipse workspace at the same time.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 29 of 31
developerWorks
ibm.com/developerWorks
Resources
Learn Learn about the Apache Pluto portal project. Visit the Liferay Web site. Investigate the Apache Jetspeed server. See what all the fuss concerning JBoss is about. Stay current regarding Eclipse happenings by visiting Planet Eclipse. Learn more about the Eclipse Foundation. Expand your Eclipse skills by visiting the IBM developerWorks Eclipse project resources area. Visit the developerWorks Open source zone for extensive how-to information, tools, and project updates to help you develop with open source technologies and use them with IBM's products. Check out the developerWorks Apache Geronimo project area for articles, tutorials, and other resources to help you get started developing with Geronimo today. Find helpful resources for beginners and experienced users at the Get started now with Apache Geronimo section of developerWorks. Check out the IBM Support for Apache Geronimo offering, which lets you develop Geronimo applications backed by world-class IBM support. Stay current with developerWorks technical events and webcasts. Browse all the Apache articles and free Apache tutorials available in the developerWorks Open source zone. Browse for books on these and other technical topics at the Safari bookstore. Get products and technologies See the latest Eclipse technology downloads at IBM alphaWorks. Download the latest version of Apache Geronimo. Download your free copy of IBM WebSphere Application Server Community Edition -- a lightweight J2EE application server built on Apache Geronimo open source technology that is designed to help you accelerate your development and deployment efforts. Innovate your next open source development project with IBM trial software, available for download or on DVD.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 30 of 31
ibm.com/developerWorks
developerWorks
Discuss Participate in the discussion forum for this content. Stay up to date on Geronimo developments at the Apache Geronimo blog. Get involved in the developerWorks community by participating in developerWorks blogs.
Trademarks
IBM, the IBM logo, and WebSphere are registered trademarks of IBM in the United States, other countries or both. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc., in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both. UNIX is a registered trademark of The Open Group in the United States and other countries. Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Build portlets with Apache Geronimo and Eclipse Copyright IBM Corporation 2007. All rights reserved.
Trademarks Page 31 of 31