Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Go to http://localhost:8080/pluto/ to verify that the portlets were added to the correct page. (You may need to refresh the browser if you deployed from the command line.)

Sample Extension

...

Code Block

...

JAVA

...

JAVA

...

borderStyle

...

solid

...

title

sdfsdf

Google link

Image Removed

HelloWorldPortlet.java

package org.apache.pluto.examples;

import java.io.IOException; 
import java.io.PrintWriter;

import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;

/**
 * A very simple portlet example.
 * This portlet displays 'Hello World' to the end user
 */
public class HelloWorldPortlet extends GenericPortlet {

    // This function is called when a user requests to view this portlet (by
    // navigating to the webpage in Pluto)
    public void doView(RenderRequest request, RenderResponse response)
            throws PortletException, IOException {

        // Set the response to read HTML
        response.setContentType("text/html;charset=UTF-8");

        // Required call for use of getWriter() and getPortletOutputStream()
        PrintWriter out = response.getWriter();
        // Write content to the portlet
        out.println("<h1>Hello World</h1>");
    }
}

Download the example WARbob.zip