1 Reply Latest reply on Oct 9, 2006 9:38 AM by Ephemeris Lappis

    [JBoss Portal][2.4] Portlet method "processAction" not calle

    Ephemeris Lappis Newbie

      Hello.

      I'm trying to write a very simple portlet that uses an action URL and process a request in its processAction method.

      The same portlet and JSP work perfectly in Jetspeed, but with JBoss portal, the processAction is never called.

      An idea ? Something missing ?

      The code of the portlet, jsp and descriptor are at the end of the message

      Thanks

      PORTLET

      package my.portal.one.portlets;
      
      import java.io.IOException;
      
      import javax.portlet.ActionRequest;
      import javax.portlet.ActionResponse;
      import javax.portlet.PortletConfig;
      import javax.portlet.PortletException;
      import javax.portlet.RenderRequest;
      import javax.portlet.RenderResponse;
      
      import my.portal.one.tools.Tracer;
      
      public class JspPortlet extends javax.portlet.GenericPortlet {
      
       private int count;
      
       @Override
       public void doView(final RenderRequest request, final RenderResponse response) throws PortletException, IOException {
       Tracer.trace(this, "Begin doView : " + request.getWindowState());
       response.setContentType("text/html");
       getPortletContext().getRequestDispatcher("/WEB-INF/jsp/page1-view.jsp").include(request, response);
       Tracer.trace(this, "End doView.");
       }
      
       @Override
       protected void doHelp(final RenderRequest request, final RenderResponse response) throws PortletException, IOException {
       Tracer.trace(this, "Begin doHelp...");
       response.setContentType("text/html");
       getPortletContext().getRequestDispatcher("/WEB-INF/jsp/page1-help.jsp").include(request, response);
       Tracer.trace(this, "End doHelp.");
       }
      
       @Override
       public void processAction(final ActionRequest request, final ActionResponse response) throws PortletException, IOException {
       Tracer.trace(this, "Begin processAction...");
       count++;
       response.setRenderParameter("count", Integer.toString(count));
       Tracer.trace(this, "End processAction. Count = " + count);
       }
      
       @Override
       public void init(final PortletConfig portletConfig) throws PortletException {
       Tracer.trace(this, "Begin init...");
       super.init(portletConfig);
       Tracer.trace(this, "End init.");
       }
      
       @Override
       public void destroy() {
       Tracer.trace(this, "Begin destroy...");
       super.destroy();
       Tracer.trace(this, "End destroy.");
       }
      
      }
      


      JSP
      <%@taglib prefix="p" uri="http://java.sun.com/portlet"%>
      <p:defineObjects/>
      Voici la <b>vue</b> !
      <br><br>
      Portal Info :
      <br><b>${renderRequest.portalContext.portalInfo}</b>
      <br><br>
      Namespace :
      <br><b><p:namespace/></b>
      <hr>
      <div align="center">
       <form action="<p:actionURL/>">
       <%
       String count = renderRequest.getParameter("count");
       %>
       Count : <b><%=count%></b>
       <br>
       <input type="submit" value="Action !">
       </form>
      </div>
      


      portlet descriptor
       <portlet id="Felipe-1.E">
      
       <description>A portlet that uses JSP pages.</description>
      
       <portlet-name>Felipe-1#5</portlet-name>
       <display-name>Felipe JSP</display-name>
      
       <portlet-class>my.portal.one.portlets.JspPortlet</portlet-class>
      
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>HELP</portlet-mode>
       </supports>
      
       <portlet-info>
       <title>Felipe-1 JSP</title>
       <short-title>Portlet using JSP pages.</short-title>
       <keywords>felipe,ephemeris,lappis,jsp</keywords>
       </portlet-info>
      
       </portlet>