Differences between revisions 1 and 2
Revision 1 as of 2005-10-23 01:13:52
Size: 1745
Comment: A very simple servlet portal tutorial
Revision 2 as of 2009-09-20 23:46:39
Size: 1742
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Please read [wiki:Jetspeed2/QuickstartForTheImpatient QuickstartForTheImpatient] before before proceeding. Please read [[Jetspeed2/QuickstartForTheImpatient|QuickstartForTheImpatient]] before before proceeding.

Please read QuickstartForTheImpatient before before proceeding.

The portlet.xml

Add a new portlet tag to one of the existing portlet applications. The security application is known to work.

edit $JETSPEED2_SRC/applications/security/src/webapps/WEB-INF/portlets.xml

The portlet tag can be placed anywhere inside the root element called portlet-app.

    <portlet id="MySimplePortlet">
        <init-param>
            <name>ViewPage</name>
            <value>/WEB-INF/security/login/simple.jsp</value>
        </init-param>
        <portlet-name>MySimplePortlet</portlet-name>
        <portlet-class>org.apache.portals.bridges.common.GenericServletPortlet</portlet-class>
    </portlet>

The psml

Add a fragment tag to one of the psml files. The default page is appropriate.

edit $JETSPEED2_SRC/src/webapp/WEB-INF/pages/default-page.psml

Note that the id must be unique. Using the same id twice will confuse Jetspeed. There is no error handling regarding this point so be creative.

    <fragment id="dp-31234" type="portlet" name="security::MySimplePortlet" >
      <property layout="TwoColumns" name="row" value="0" />
      <property layout="TwoColumns" name="column" value="0" />
    </fragment>       

The JSP

We did say that this is a simple servlet portlet, so the JSP will be simple.

edit $JETSPEED2_SRC/applications/security/src/webapps/WEB-INF/security/login/simple.jsp

Here are the contents of a very simple JSP.

<%@page import="java.util.Date"%>
The time is <%=(new Date()).toString()%>

See Jetspeed is so simple. Even your mum could start an Enterprise portal.

Jetspeed2/QuickstartForTheImpatient/CreateYourOwnSimpleServletPortlet (last edited 2009-09-20 23:46:39 by localhost)