Everything Java Apache Geospatial Open Source. Hello Shinning Stars!!! Vincent Massol, Raphael Luta, Santiago Gala, Carsten Z.

Saturday, October 22, 2005

Another short tutorial on the Jetspeed portlet.

CreateYourOwnSimpleServletPortal

= The portlet.xml =

Add a new portlet tag to one of the existing portlet applications. The security application is know 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.

{{{


ViewPage
/WEB-INF/security/login/simple.jsp

MySimplePortlet
org.apache.portals.bridges.common.GenericServletPortlet

}}}

= 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.

{{{




}}}

= 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()%>
}}}

No comments: