portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raph...@apache.org
Subject cvs commit: jakarta-jetspeed/src/java/org/apache/jetspeed/portal/portlets JspPortlet.java
Date Sun, 14 Oct 2001 12:59:09 GMT
raphael     01/10/14 05:59:09

  Modified:    src/java/org/apache/jetspeed/portal/portlets JspPortlet.java
  Log:
  fix for bug 4147: modify JspPortlet to use Turbine JspService so that the
  jetspeed taglib can be used fully within the portlet.
  
  Revision  Changes    Path
  1.2       +14 -9     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JspPortlet.java	2001/07/02 07:38:10	1.1
  +++ JspPortlet.java	2001/10/14 12:59:09	1.2
  @@ -56,6 +56,8 @@
   
   // Turbine util
   import org.apache.turbine.util.RunData;
  +import org.apache.turbine.services.TurbineServices;
  +import org.apache.turbine.services.jsp.JspService;
   import org.apache.turbine.util.Log;
   
   // Jetspeed portal
  @@ -64,11 +66,9 @@
   import org.apache.jetspeed.portal.PortletException;
   import org.apache.jetspeed.portal.PortletConfig;
   
  -// Jetspeed util
  -import org.apache.jetspeed.util.servlet.EcsServletElement;
  -
   // Ecs 
   import org.apache.ecs.ConcreteElement;
  +import org.apache.ecs.ElementContainer;
   import org.apache.ecs.StringElement;
   
   
  @@ -92,7 +92,6 @@
       public ConcreteElement getContent( RunData rundata )
       {
   
  -        EcsServletElement element ;
           String template = "";
   
           try {
  @@ -102,7 +101,16 @@
               // NOTE: wouldn't it be better to get the param from the PSML?
               //
               template = getPortletConfig().getInitParameter("template");
  -            element = new EcsServletElement(rundata, template);
  +            // FIXME: we should use the template locator service
  +            
  +            JspService service = (JspService)TurbineServices.getInstance()
  +                                             .getService(JspService.SERVICE_NAME);
  +            // this is only necessary if we ddon't run in a JSP page environment
  +            // but better be safe than sorry...
  +            service.addDefaultObjects(rundata);
  +            
  +            // handle request
  +            service.handleRequest(rundata, template);
               
           } catch (Exception e) {
               String message = "JspPortlet: Could not include the following JSP Page:  "
+ template + " : " + e.getMessage();
  @@ -110,10 +118,7 @@
               return new StringElement( message );
           }
   
  -        //ElementContainer content = new ElementContainer();
  -        //content.addElement( jspEl );
  -        
  -        return element;
  +        return new ElementContainer();
       }
   
   }
  
  
  

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


Mime
View raw message