# Creating Portlets

If the pre-built portlets in the Portlet Library do not match your current needs, you can create new portlets in a variety of ways, including through the use of the Portlet Wizard.

A new portlet can be associated with an existing resource, or created first and associated with a resource later. The Portlet Wizard is invoked in the WebLogic Workshop IDE anytime you perform one of these operations:

- Select File > New > Portlet from the IDE's top-level menu. Or right-mouse click on a folder in your web application, and select New > Portlet. After naming the portlet and choosing the Create button, the Portlet Wizard is invoked and you can select the portlet type.
- Drag and drop a resource such as a JSP from the Application pane onto a placeholder area of an open portal. (That is, a <portal-name>.portal file is open in the Portal Designer.) WebLogic Workshop prompts you:

  If you select Yes, the Portlet Wizard is invoked in the same way shown for the next case.

- Right-mouse click on an existing resource such as a JSP page, a page flow, a portal placeholder, or a portal content selector; then select Generate Portlet... from the menu. The Portlet Wizard displays a Details screen. For example, here we had right-mouse clicked on a JSP file.

## Types of Portlets Created by the Portlet Wizard

The Portlet Wizard can create several types of portlets. The portlet type is set on the wizard's first screen; when generating a portlet for an existing resource, the type may have been already detected.

Type | Description
JSP/HTML Portlet | Creates a portlet that points to a JSP or HTML file for its content. These types of portlets can be simple to implement and deploy, and provide basic functionality without a lot of complexity. However, business logic and presentation layer can get combined in the JSPs; as the application grows, this often leads to escalating maintenance costs while trying to update the webapp and share code. This type of portlet is not well suited for advanced portlet navigation.
Java Portlet | Creates a JSR 168 compliant portlet. This creates a Java file. Accommodates portability for portlets across platforms. Does not require the use of portal server specific JSP tags. The behavior is similar to a Servlet (although there are differences). For related information, see "Developing JSR 168 Portlets with WebLogic Portal 8.1" on the BEA dev2dev site. This type of portlet is intended for software companies and other enterprises that are concerned with portability across multiple portlet containers. Current disadvantages are that this type of portlet does not leverage BEA advanced portlet features, and this type requires a deeper understanding of the J2EE programming model.
Java Page Flow Portlet | Creates a portlet that uses Java Page Flows to retrieve its content. Allow you to separate the user interface code from navigation control and other business logic. Provides the ability to model both simple and advanced portlet navigation. Allow you to leverage other resources such as Java Controls and Web Services. Provides a visual IDE environment to build rich applications based on Struts. The advanced page flow features are not necessary for static or simple, one-view portlets.
Struts Portlet | Creates a Struts-based portlet.
Remote Portlet | Creates a WSRP-compliant remote, or "proxy," portlet. These portlets present content collected from WSRP-compliant producers, allowing you to leverage external sources for portlet content, rather than have to create this content or its framework yourself.

The following topics describe the options you have while generating these types of portlets.

- Building JSP/HTML Portlets
- Building Java Portlets
- Building Java Page Flow Portlets
- Building Struts Portlets
- Building a Remote Portlet
- In addition, you can create portlets that use web services. See Creating a Web Services Portlet.

Related Topics

Building Portlets