portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morci...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets JspPortlet.java
Date Wed, 28 Aug 2002 18:15:55 GMT
morciuch    2002/08/28 11:15:55

  Modified:    src/java/org/apache/jetspeed/portal/portlets JspPortlet.java
  Log:
  Added reference to "portlet" in JSP context + support for "action" parameter (see Bugzilla
issue 11864)
  
  Revision  Changes    Path
  1.4       +22 -0     jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/JspPortlet.java
  
  Index: JspPortlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets/JspPortlet.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JspPortlet.java	16 Oct 2001 14:24:27 -0000	1.3
  +++ JspPortlet.java	28 Aug 2002 18:15:55 -0000	1.4
  @@ -59,6 +59,7 @@
   import org.apache.turbine.services.TurbineServices;
   import org.apache.turbine.services.jsp.JspService;
   import org.apache.turbine.util.Log;
  +import org.apache.turbine.modules.ActionLoader;
   
   // Jetspeed portal
   import org.apache.jetspeed.portal.Portlet;
  @@ -115,6 +116,27 @@
               // this is only necessary if we ddon't run in a JSP page environment
               // but better be safe than sorry...
               service.addDefaultObjects(rundata);
  +
  +            // Allow access to portlet from .jsp template
  +            rundata.getRequest().setAttribute("portlet", this);
  +
  +	    // Retrieve and execute the action object
  +	    String actionName = getPortletConfig().getInitParameter("action");
  +	    if (actionName != null) 
  +            {
  +		try 
  +                {
  +                    if (Log.getLogger().isDebugEnabled())
  +                    {
  +                        Log.debug("JspPorlet: Executing action [" + actionName + "] for
portlet [" + this.getName() + "]");
  +                    }
  +		    ActionLoader.getInstance().exec(rundata, actionName);
  +		} 
  +                catch( Exception e) 
  +                {
  +		    Log.error(e);
  +		}
  +	    }
               
               // handle request
               service.handleRequest(rundata, locatedTemplate);
  
  
  

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message