Initially, WordPress gives a Hello World post upon creating a blog. I figured, since I’m a programmer, why not say Hello the Java Portlet way? But it’s not complete when u don’t have the configuration in the two XMLs needed; web.xml & portlet.xml.
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Hello World Portlet</display-name>
<description>Basic Sample Portlet</description>
</web-app>
portlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<description xml:lang="en">A Hello World Portlet</description>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name xml:lang="en">Hello World</display-name>
<portlet-class>example.portlet.HelloWorldPortlet</portlet-class>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Hello World</title>
<short-title>Hello</short-title>
<keywords>portlet, hello, world</keywords>
</portlet-info>
</portlet>
</portlet-app>
Compile the class, war it, plug it in, and you should have a simple, normally-used-for-testing Hello World portlet.