Tuesday, September 21, 2004

Porting a struts-based web application module into eXo Portal

First of all, I should thanks Punit Pandey for providing a good comparison among java portals solutions. When I read his article, I could make my decision to choose a portal as a platform for developing tomorrow application! Thank Mr. Benjamin Mestrallet and his staff for providing this wonderful portal.

The following steps should be perform to port a struts-based web application module into eXo Portal:
  1. ExoStrutsPortlet should be introduced as the portlet class:
    File: portlet.xml
  2. <portlet-app  ... >
    
    <portlet>
    ...
    <portlet-class>exo.portal.portlet.struts.ExoStrutsPortlet</portlet-class>
    </portlet>
    </portlet-app>

  3. welcome file of the application should be introduced as default-page:
    File: portlet.xml
  4. <portlet-app  ... >
    
    <portlet>
    ...
    <init-param>
    <name>default-page</name>
    <value>/login.jsp</value>
    </init-param>
    </portlet>
    </portlet-app>

    Of course you should add mandatory parts, such as supported modes


  5. PortletApplicationListener and ServletWrapper should be introduced in the web application as follow:
    File: web.xml

    <web-app>
    
    <listener>
    <listener-class>exo.services.portletcontainer.impl.servlet.PortletApplicationListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>PortletWrapper</servlet-name>
    <servlet-class>exo.services.portletcontainer.impl.servlet.ServletWrapper</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>PortletWrapper</servlet-name>
    <url-pattern>/PortletWrapper</url-pattern>
    </servlet-mapping>
    </web-app>
  6. ExoActionServlet and /struts-controller should be introduce as action servlet class and its related mapping, as follow:
    File: web.xml
  7. <servlet>
    
    <servlet-name>action</servlet-name>
    <servlet-class>exo.portal.portlet.struts.ExoActionServlet</servlet-class>
    ...
    </servlet>

    <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>/struts-controller</url-pattern>
    </servlet-mapping>

  8. ExoRequestProcessor should be added as request processor of the application module as follow:
    File: struts-config.xml
  9. <controller processorClass="exo.portal.portlet.struts.ExoRequestProcessor"
    
    debug="1" contentType="text/html">
    ...
    </controller>


Your feedbacks are welcome masoud.omidvar@gmail.com