1 16 17 18 package org.apache.jetspeed.portal.portlets; 19 20 import org.apache.ecs.ConcreteElement; 21 import org.apache.ecs.StringElement; 22 23 import org.apache.jetspeed.portal.PortletConfig; 24 import org.apache.jetspeed.services.logging.JetspeedLogFactoryService; 25 import org.apache.jetspeed.services.logging.JetspeedLogger; 26 import org.apache.jetspeed.portal.portlets.AbstractPortlet; 27 import org.apache.jetspeed.util.servlet.EcsServletElement; 28 29 import org.apache.turbine.util.RunData; 30 31 36 public class ServletInvokerPortlet extends AbstractPortlet 37 { 38 39 42 private static final JetspeedLogger logger = JetspeedLogFactoryService.getLogger(ServletInvokerPortlet.class.getName()); 43 44 50 public ConcreteElement getContent(RunData rundata) { 51 PortletConfig pc = this.getPortletConfig(); 53 54 String servletURL = null; 55 try { 56 servletURL = (String ) this.getPortletConfig().getInitParameter("url"); 57 return new EcsServletElement(rundata, servletURL); 58 } catch (Exception e) { 59 String message = "ServletInvokerPortlet: Error invoking " 60 + servletURL + ": " + e.getMessage(); 61 logger.error(message, e); 62 return new StringElement(message); 63 } 64 } } | Popular Tags |